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

[DOCKER] Cache files can't get generated in a rootless docker container / Openshift #1090

Closed
b2cc opened this issue May 4, 2024 · 2 comments

Comments

@b2cc
Copy link

b2cc commented May 4, 2024

I recently spun up Rallly on Openshift, which by default locks down containers ("pods") in various ways. Amongst others, one thing it does is assign an arbitrary user ID to the container, which can mess with applications that are unaware of this behavior.

In this case, after the application has finished start-up, an error is displayed since the application can't write to its own filesystem:

Failed to update prerender cache for /404 [Error: EACCES: permission denied, open '/app/apps/web/.next/server/app/404.html'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/app/apps/web/.next/server/app/404.html'
}

User ID in container:

# log into container
~# oc rsh rallly-6c8d89969d-vwdr8

# get user ID
$ id
uid=1000980000(1000980000) gid=0(root) groups=0(root),1000980000

# list permissions of folders
$ ls -lah /app/apps/web/.next/server/   
[ ... ]
drwxr-xr-x. 25 nextjs nodejs 4.0K Mar 15 05:10 app

Is there a way to set the cache directory for the framework via e.g. a NEXT_ env variable?

EDIT: I found this, maybe there is another way?

To Reproduce
Start the container in rootless mode

Expected behavior
Cache files get generated successfully

Additional context
Tested on Openshift 4.14 / x86_64

Thanks for the great app and your support!

@jirutka
Copy link

jirutka commented May 29, 2024

I have the same problem when running Rallly from a read-only filesystem.

Do I understand it correctly that it’s trying to create a file 404.html in apps/web/.next/server/? This isn’t even a cache directory.

@lukevella
Copy link
Owner

Unfortunately, I'm not aware of a solution and cannot spare the time to research this. Please feel free to reopen with a solution if you are aware of one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants