[GH-ISSUE #3397] [bug]: Problem using Podman, permission denied because of build.env #1136

Closed
opened 2026-03-16 18:49:03 +03:00 by kerem · 3 comments
Owner

Originally created by @felixsanz on GitHub (Sep 27, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3397

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When trying to run hoppscortch, both using recommended 3 containers or using the AIO, this error is generated:

Error: EACCES: permission denied, open 'build.env'

Generating this build.env inside /usr/prod_run.mjs looks a bit nonsense. But anyway, if I try to mount this path to a local path/volume, so the permissions are correct, then the error is: /bin/sh: node: not found.

I'm at a dead point now. What can be done? I was thinking about replacing /usr/prod_run.mjs with a local version that doesn't generate this build.env file, but not sure about how to bypass it.

This is the original code:

fs.writeFileSync("build.env", envFileContent)

execSync(`npx import-meta-env -x build.env -e build.env -p "/site/**/*"`)

fs.rmSync("build.env")

Why this temporal file needs to be created? Can't the app just read the env variables from process.env ? What workaround can be done here?

If someone could help me understand the -x, -e and -p... I can't find the documentation for it.

Steps to reproduce

Execute container with:

podman run --rm \
  --pod hoppscotch \
  --name api-frontend \
  --env VITE_BASE_URL="http://localhost:3000" \
  docker.io/hoppscotch/hoppscotch-frontend:latest

Environment

Production

Version

Self-hosted

Originally created by @felixsanz on GitHub (Sep 27, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3397 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When trying to run hoppscortch, both using recommended 3 containers or using the AIO, this error is generated: `Error: EACCES: permission denied, open 'build.env'` Generating this build.env inside `/usr/prod_run.mjs` looks a bit nonsense. But anyway, if I try to mount this path to a local path/volume, so the permissions are correct, then the error is: `/bin/sh: node: not found`. I'm at a dead point now. What can be done? I was thinking about replacing `/usr/prod_run.mjs` with a local version that doesn't generate this `build.env` file, but not sure about how to bypass it. This is the original code: ``` fs.writeFileSync("build.env", envFileContent) execSync(`npx import-meta-env -x build.env -e build.env -p "/site/**/*"`) fs.rmSync("build.env") ``` Why this temporal file needs to be created? Can't the app just read the env variables from `process.env` ? What workaround can be done here? If someone could help me understand the `-x`, `-e` and `-p`... I can't find the documentation for it. ### Steps to reproduce Execute container with: ``` podman run --rm \ --pod hoppscotch \ --name api-frontend \ --env VITE_BASE_URL="http://localhost:3000" \ docker.io/hoppscotch/hoppscotch-frontend:latest ``` ### Environment Production ### Version Self-hosted
kerem 2026-03-16 18:49:03 +03:00
Author
Owner

@felixsanz commented on GitHub (Sep 28, 2023):

my bad. i was messing up the user namespace

<!-- gh-comment-id:1738314453 --> @felixsanz commented on GitHub (Sep 28, 2023): my bad. i was messing up the user namespace
Author
Owner

@bcoquell commented on GitHub (Oct 10, 2023):

Hi, sorry I actually encounter the same kind of issue when trying to launch hoppscoth-aio in an Openshift context.
What do you mean by "user namespace", how did you fix this @felixsanz ?
Thanks by advance for your answer
BR

<!-- gh-comment-id:1755526088 --> @bcoquell commented on GitHub (Oct 10, 2023): Hi, sorry I actually encounter the same kind of issue when trying to launch hoppscoth-aio in an Openshift context. What do you mean by "user namespace", how did you fix this @felixsanz ? Thanks by advance for your answer BR
Author
Owner

@felixsanz commented on GitHub (Oct 10, 2023):

Hi, sorry I actually encounter the same kind of issue when trying to lauche hoppscoth-aio in an Openshift context. What do you mean by "user namespace", how did you fix this @felixsanz ? Thanks by advance for your answer BR

basically the container needs rw permissions to create a file on that folder. if you're using a volume, it has the wrong permissions. I don't know about Openshift but it's probably messing up with --userns podman variable

<!-- gh-comment-id:1755540471 --> @felixsanz commented on GitHub (Oct 10, 2023): > Hi, sorry I actually encounter the same kind of issue when trying to lauche hoppscoth-aio in an Openshift context. What do you mean by "user namespace", how did you fix this @felixsanz ? Thanks by advance for your answer BR basically the container needs rw permissions to create a file on that folder. if you're using a volume, it has the wrong permissions. I don't know about Openshift but it's probably messing up with `--userns` podman variable
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1136
No description provided.