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

UpdateCheck leads to endless restarts #21192

Closed
feitzi opened this issue Jan 25, 2024 · 2 comments · Fixed by #21193
Closed

UpdateCheck leads to endless restarts #21192

feitzi opened this issue Jan 25, 2024 · 2 comments · Fixed by #21193

Comments

@feitzi
Copy link

feitzi commented Jan 25, 2024

Describe the Bug

With 10.8.3 the update check leads to a endless restart loop if the check triggers a failure.
Here is the log:


Jan 25 10:52:28 DIRECTUS_HOST systemd[1]: Started Directus 9.
Jan 25 10:52:28 DIRECTUS_HOST npx[16194]: file:///opt/directus/node_modules/@directus/update-check/dist/index.js:62
Jan 25 10:52:28 DIRECTUS_HOST npx[16194]:  const latestVersion = packageManifest["dist-tags"]["latest"];
Jan 25 10:52:28 DIRECTUS_HOST npx[16194]:                                                    ^
Jan 25 10:52:28 DIRECTUS_HOST npx[16194]: TypeError: Cannot read properties of undefined (reading 'latest')
Jan 25 10:52:28 DIRECTUS_HOST npx[16194]:    at updateCheck (file:///opt/directus/node_modules/@directus/update-check/dist/index.js:62:53)
Jan 25 10:52:28 DIRECTUS_HOST npx[16194]:    at async file:///opt/directus/node_modules/directus/cli.js:6:2
Jan 25 10:52:28 DIRECTUS_HOST npx[16194]: Node.js v18.17.1
Jan 25 10:52:28 DIRECTUS_HOST systemd[1]: directus.service: Main process exited, code=exited, status=1/FAILURE
Jan 25 10:52:28 DIRECTUS_HOST systemd[1]: directus.service: Failed with result 'exit-code'.
Jan 25 10:52:30 DIRECTUS_HOST systemd[1]: directus.service: Scheduled restart job, restart counter is at 234.
Jan 25 10:52:30 DIRECTUS_HOST systemd[1]: Stopped Directus 9.
Jan 25 10:52:30 DIRECTUS_HOST systemd[1]: Started Directus 9.
Jan 25 10:52:30 DIRECTUS_HOST npx[16225]: file:///opt/directus/node_modules/@directus/update-check/dist/index.js:62
Jan 25 10:52:30 DIRECTUS_HOST npx[16225]:  const latestVersion = packageManifest["dist-tags"]["latest"];
Jan 25 10:52:30 DIRECTUS_HOST npx[16225]:                                                    ^
Jan 25 10:52:30 DIRECTUS_HOST npx[16225]: TypeError: Cannot read properties of undefined (reading 'latest')
Jan 25 10:52:30 DIRECTUS_HOST npx[16225]:    at updateCheck (file:///opt/directus/node_modules/@directus/update-check/dist/index.js:62:53)
Jan 25 10:52:30 DIRECTUS_HOST npx[16225]:    at async file:///opt/directus/node_modules/directus/cli.js:6:2
Jan 25 10:52:30 DIRECTUS_HOST npx[16225]: Node.js v18.17.1
Jan 25 10:52:30 DIRECTUS_HOST systemd[1]: directus.service: Main process exited, code=exited, status=1/FAILURE
Jan 25 10:52:30 DIRECTUS_HOST systemd[1]: directus.service: Failed with result 'exit-code'.
Jan 25 10:52:31 DIRECTUS_HOST systemd[1]: directus.service: Scheduled restart job, restart counter is at 235.

We have downgraded to 10.8.2 and now everything is working fine!
In our opinion, directus should not cause an error if the update check fails! Maybe directus should try/catch the whole update check method?

To Reproduce

Update from 10.8.3 from 10.8.2 via NPM

Directus Version

V10.8.3

Hosting Strategy

Self-Hosted (Custom)

@paescuj
Copy link
Member

paescuj commented Jan 25, 2024

Thanks for opening this issue!
This should be a rare case, nevertheless a fix is provided in #21193.
In the meantime you should be able to resolve the issue on your side by deleting the folder node_modules/.cache/directus.

@feitzi
Copy link
Author

feitzi commented Jan 25, 2024

Perfect, thanks for the fast replay and the PR! We will wait for the release :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants