Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run build fails when nmetadata are missing #10069

Closed
3 of 7 tasks
wagnbeu0 opened this issue Apr 23, 2024 · 6 comments
Closed
3 of 7 tasks

npm run build fails when nmetadata are missing #10069

wagnbeu0 opened this issue Apr 23, 2024 · 6 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: can't repro This bug is because of some local setup that can't be reproduced.

Comments

@wagnbeu0
Copy link

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Hi, I have a git repository as source for my webpage. with docusaurus 3.1 I get a warning:

[WARNING] Error: Failed to retrieve the git history for file "/opt/ARTOPS_DOKU/docs/tutorial-extras/translate-your-site.md" with exit code 128: fatal: not a git repository (or any parent up to mount point /opt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Now I updates to 3.2.1 and the build os now aborting:

[INFO] [en] Creating an optimized production build...
[ERROR] Loading of version failed for version current

[ERROR] Error: Unable to build website for locale en.
at tryToBuildLocale (/opt/ARTOPS_DOKU/node_modules/@docusaurus/core/lib/commands/build.js:53:19)
at async /opt/ARTOPS_DOKU/node_modules/@docusaurus/core/lib/commands/build.js:64:9
at async mapAsyncSequential (/opt/ARTOPS_DOKU/node_modules/@docusaurus/utils/lib/jsUtils.js:20:24)
at async Command.build (/opt/ARTOPS_DOKU/node_modules/@docusaurus/core/lib/commands/build.js:62:5) {
...
[cause]: Error: Failed to retrieve the git history for file "/opt/ARTOPS_DOKU/docs/tutorial-extras/translate-your-site.md" with exit code 128: Schwerwiegend: Kein Git-Repository (oder irgendeines der Elternverzeichnisse): .git

...

What can I do to enable the build again? I think problem is caused by the following parameters:

      showLastUpdateAuthor: true,
      showLastUpdateTime: true,

Reproducible demo

No response

Steps to reproduce

Docusaurus is installed under /opt/ARTOPS_DOKU. A git Repo is cloned to /opt/ARTOPS_DOKU/docu/Doku. In /opt/ARTOPS_DOKU/docu the efault files from docusaurus are located.
When running npm run build docusaurus 3.2.1 is aborting.

Expected behavior

Behaviour from all version up to 3.1.1:
All files are searched for last modified user and last modified time. Then the webpages are created. If a file has not git information, a warning is reported, but the webpage is build.

Actual behavior

New behaviour since 3.2.1:
All files are searched for last modified user and last modified time. But the webpages are created, If a file has not git information, because a warning is reported and the buold is aborted.

Your environment

  • Public source code: no
  • Public site URL: internal
  • Docusaurus version used: 3.2.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): nodejs16
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): RedHat 8

Self-service

  • I'd be willing to fix this bug myself.
@wagnbeu0 wagnbeu0 added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 23, 2024
@OzakIOne
Copy link
Contributor

Indeed this is caused by the two options, I'm not sure if we changed the internal behavior in version 3.2.1

      showLastUpdateAuthor: true,
      showLastUpdateTime: true,

Docusaurus is installed under /opt/ARTOPS_DOKU. A git Repo is cloned to /opt/ARTOPS_DOKU/docu/Doku

I'm not sure to understand correctly what you mean by Docusaurus is installed in ARTOPS_DOKU and then a git repo is cloned to ARTOPS_DOKU/docu/Doku

Meanwhile you can disable the two options

@wagnbeu0
Copy link
Author

Hi, I installed Docusaurus there:

cd /opt/
npx create-docusaurus@latest ARTOPS_DOKU classic

Later I cloned my documentation repo into a subfolder:

mkdir /opt/ARTOPS_DOKU/docs/Docu
git clone https://my-git-servert/reponame /opt/ARTOPS_DOKU/docs/Docu

@slorber
Copy link
Collaborator

slorber commented Apr 25, 2024

These options require Git indeed.

CleanShot 2024-04-25 at 11 34 13

If you don't use Git you should turn them off. If you use Git, double-check your setup.

We run git log on your docs files, so if it already doesn't work outside of Docusaurus by running manual commands, it won't work better inside Docusaurus. Use the Git error messages to troubleshoot that outside Docusaurus.

Also closing because we need a repro to troubleshoot problems, and no repro was provided

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2024
@slorber slorber added closed: can't repro This bug is because of some local setup that can't be reproduced. and removed status: needs triage This issue has not been triaged by maintainers labels Apr 25, 2024
@sibelius
Copy link

we are getting this error when using git

[INFO] [en] Creating an optimized production build...
[ERROR] Loading of version failed for version current

[ERROR] Error: Unable to build website for locale en.
at tryToBuildLocale (dev-docs/node_modules/@docusaurus/core/lib/commands/build.js:54:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async dev-docs/node_modules/@docusaurus/core/lib/commands/build.js:65:9
at async mapAsyncSequential (dev-docs/node_modules/@docusaurus/utils/lib/jsUtils.js:21:24)
at async Command.build (dev-docs/node_modules/@docusaurus/core/lib/commands/build.js:63:5) {
[cause]: Error: Can't process doc metadata for doc at path path=dev-docs/docs/charge/charge-intent/credit/how-to/charge-credit-how-to-pay.md in version name=current
at processDocMetadata (dev-docs/node_modules/@docusaurus/plugin-content-docs/lib/docs.js:151:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Promise.all (index 2222)
... 3 lines matching cause stack trace ...
at async Object.loadContent (dev-docs/node_modules/@docusaurus/plugin-content-docs/lib/index.js:171:33)
at async dev-docs/node_modules/@docusaurus/core/lib/server/plugins/plugins.js:39:23
at async Promise.all (index 0)
at async dev-docs/node_modules/@docusaurus/core/lib/server/plugins/plugins.js:140:25 {
[cause]: Error: An error occurred when trying to get the last update date
at getGitLastUpdate (dev-docs/node_modules/@docusaurus/utils/lib/lastUpdateUtils.js:46:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async readLastUpdateData (dev-docs/node_modules/@docusaurus/utils/lib/lastUpdateUtils.js:78:33)
... 5 lines matching cause stack trace ...
at async Promise.all (index 0)
at async Object.loadContent (dev-docs/node_modules/@docusaurus/plugin-content-docs/lib/index.js:171:33) {
[cause]: Error: Failed to retrieve the git history for file "dev-docs/docs/charge/charge-intent/credit/how-to/charge-credit-how-to-pay.md" with exit code EAGAIN:
at getFileCommitDate (dev-docs/node_modules/@docusaurus/utils/lib/gitUtils.js:56:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async getGitLastUpdate (dev-docs/node_modules/@docusaurus/utils/lib/lastUpdateUtils.js:26:24)
at async readLastUpdateData (dev-docs/node_modules/@docusaurus/utils/lib/lastUpdateUtils.js:78:33)
at async doProcessDocMetadata (dev-docs/node_modules/@docusaurus/plugin-content-docs/lib/docs.js:53:24)
at async processDocMetadata (dev-docs/node_modules/@docusaurus/plugin-content-docs/lib/docs.js:148:16)
at async Promise.all (index 2222)
at async doLoadVersion (dev-docs/node_modules/@docusaurus/plugin-content-docs/lib/index.js:122:34)
at async loadVersion (dev-docs/node_modules/@docusaurus/plugin-content-docs/lib/index.js:163:28)
at async Promise.all (index 0)
}
}
}

@slorber
Copy link
Collaborator

slorber commented Oct 14, 2024

@sibelius are you able to run git log on the file?

Are you manipulating it through other processes at the same time?

Can you try to apply a patch like this locally and see if it solves the problem?
#10354

@sibelius
Copy link

[cause]: Error: Failed to retrieve the git history for file "dev-docs/docs/charge/analytics/updates/2023/dec-2023/charge-analytics-updates-dec-15-2023.md" with exit code EAGAIN: 

git log works well

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: can't repro This bug is because of some local setup that can't be reproduced.
Projects
None yet
Development

No branches or pull requests

4 participants