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

Outdated version of string-width is causing the Docker image entrypoint loading to fail. #20065

Closed
1 task done
LaurentGoderre opened this issue Apr 22, 2024 · 13 comments
Closed
1 task done
Labels
bug [triage] something behaving unexpectedly

Comments

@LaurentGoderre
Copy link
Contributor

Issue Summary

The update to fix arm32 architecture (c2485af) introduce a regression in the way the Ghost package is launched. When running node index.js there is a module resolution error similar to this issue nrwl/nx#19249. I managed to solve the issue locally by adding "string-width": "4.2.3" to the resolutions section.

Here is the Docker test showing the error: https://github.com/docker-library/ghost/actions/runs/8756974313/job/24034646549

I would like to contribute this fix but I am not sure which package.json to use because the packaged one seems to be generated from the source ones.

Steps to Reproduce

There is probably an more streamlined reproducible but building the Docker image here then running it (https://github.com/docker-library/ghost/tree/master/5/debian)

docker build -t ghost .
docker run --rm ghost 

Ghost Version

5.82.3

Node.js Version

18., 20.

How did you install Ghost?

In Docker using the Ghost CLI

Database type

MySQL 5.7

Browser & OS version

No response

Relevant log / error output

No response

Code of Conduct

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Apr 22, 2024
@zac
Copy link

zac commented Apr 23, 2024

I'm also seeing this in my docker build. Let me know if I can help provide any more info 👍

@ngeorger
Copy link

Currently I'm using kubernetes and a different approach to the entrypoint. I'm using distroless node 20 debian 12 as the final stage, and the entrypoint is actually a nodejs script which moves the themes and then inits the main function to start ghost.
At the moment I'm not having any issue at least with arm64. If it suits you, you can test it out too, because anyways it's still based on the "official" image (at least in the logic and general workflow of the dockerfile)

@sredevopsorg/ghost-on-kubernetes

@tianon
Copy link

tianon commented May 8, 2024

cc @acburdine 🙇 ❤️

(this is currently blocking updates to the ghost Docker image 😭)

ngeorger added a commit to ngeorger/ghost that referenced this issue May 9, 2024
I'm curious if this works here, ref:

TryGhost/Ghost#20065
@ngeorger
Copy link

ngeorger commented May 9, 2024

cc @acburdine 🙇 ❤️

(this is currently blocking updates to the ghost Docker image 😭)

Hope this helps (and works 😂) docker-library/ghost#414

@daniellockyer
Copy link
Member

This is weird 🤔

We haven't been seeing this with our internal builds but I do know we've run into it a few times with local dev. I think yarn is hoisting different versions of string-width up to the root, but I'm not entirely sure why

@daniellockyer daniellockyer added the bug [triage] something behaving unexpectedly label May 9, 2024
@github-actions github-actions bot removed the needs:triage [triage] this needs to be triaged by the Ghost team label May 9, 2024
@daniellockyer
Copy link
Member

daniellockyer commented May 9, 2024

Potentially related to isaacs/jackspeak#5 + storybookjs/storybook#22431 (comment)

@ngeorger
Copy link

ngeorger commented May 9, 2024

This is weird 🤔

We haven't been seeing this with our internal builds but I do know we've run into it a few times with local dev. I think yarn is hoisting different versions of string-width up to the root, but I'm not entirely sure why

The script which runs their tests is where the CI fails, at least as my understanding, probably I0m wrong: https://github.com/ngeorger/ghost/actions/runs/9014939335/job/24768631225#step:7:16

My approach is a bit different, I'm using multi stage builds and running fine on Kubernetes, both arm64 and amd64.

Maybe this helps a bit :) https://github.com/sredevopsorg/ghost-on-kubernetes/blob/19c3c93ec92c9f728a0e99cbf03f5bc490a0e847/Dockerfile#L5

PS: I actually solved many crashes using yarn instead of npm, I guess uou are right :)

Regards from Chile!

@daniellockyer
Copy link
Member

Can people try using Yarn v1.22.22? Apparently they fixed the transitive dependencies bug in that: https://github.com/yarnpkg/yarn/releases/tag/v1.22.22

@daniellockyer
Copy link
Member

In fact, I think I'll just add a jackspeak resolution, as that solves it for most people

daniellockyer added a commit that referenced this issue May 9, 2024
fixes #20065
refs storybookjs/storybook#22431 (comment)
refs isaacs/jackspeak#5

- this adds a resolution for jackspeak, which is a dependency deep
  inside storybook
- somewhere deep in the dependency tree, we're requiring an ESM package
  from a CJS package, which is causing issues
- this should hopefully avoid that by pinning jackspeak to a working
  version
daniellockyer added a commit that referenced this issue May 9, 2024
fixes #20065
refs storybookjs/storybook#22431 (comment)
refs isaacs/jackspeak#5

- this adds a resolution for jackspeak, which is a dependency deep
  inside storybook
- somewhere deep in the dependency tree, we're requiring an ESM
  package from a CJS package, which is causing issues
- this should hopefully avoid that by pinning jackspeak to a working version
@daniellockyer
Copy link
Member

Let's give this a go 🙂 Let me know if it re-occurs

@muratcorlu
Copy link

Does that mean the solution didn't work? Or do we need to wait for next release?

@LaurentGoderre
Copy link
Contributor Author

We need to wait for the release (should have checked the history log before opening the PR)

@daniellockyer
Copy link
Member

Yep sorry, next release (today)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

6 participants