[RoninUI] 502 Bad Gateway / Could not find a production build in the '.next' directory #9

Closed
opened 2026-05-27 13:01:54 +00:00 by lasermind · 5 comments
Contributor

After building RoninOS and running the plug'n'play setup on a new machine, I noticed that the webpage of RoninUI does not work any more. I was greeted by "502 Bad Gateway". Oooff. Nginx seems to run, but there is nothing behind it to serve.

rd3-badgateway

In roninui.log, I see thousands of errors, always the same one:

$ next start
▲ Next.js 16.2.4
- Local:         http://localhost:8470
- Network:       http://192.168.0.21:8470
✓ Ready in 405ms
Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
    at ignore-listed frames
[ELIFECYCLE] Command failed with exit code 1.

I also noticed an odd-looking and empty directory named nextjs-nodejs in /home/ronin/.config/. What is this?

There is a .next directory created in "/home/ronin/.ronindojo/roninui/", even with contents in it, but how can we be sure it is complete and accessed by the webserver?

However, setup.log looks fine, no error there — "All RoninDojo feature installations complete!"

What went wrong here, can someone have a look? Some of the latest changes must have produced this.

After building RoninOS and running the plug'n'play setup on a new machine, I noticed that the webpage of RoninUI does not work any more. I was greeted by "502 Bad Gateway". Oooff. Nginx seems to run, but there is nothing behind it to serve. ![rd3-badgateway](/attachments/8f39bb32-7dcc-43e0-8f46-b8f52be4fef8) In `roninui.log`, I see thousands of errors, always the same one: ``` $ next start ▲ Next.js 16.2.4 - Local: http://localhost:8470 - Network: http://192.168.0.21:8470 ✓ Ready in 405ms Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id at ignore-listed frames [ELIFECYCLE] Command failed with exit code 1. ``` I also noticed an odd-looking and empty directory named `nextjs-nodejs` in /home/ronin/.config/. What is this? There is a `.next` directory created in "/home/ronin/.ronindojo/roninui/", even with contents in it, but how can we be sure it is complete and accessed by the webserver? However, `setup.log` looks fine, no error there — "All RoninDojo feature installations complete!" What went wrong here, can someone have a look? Some of the latest changes must have produced this.
Author
Contributor

... also, if it is not asked too much, it would be very helpful to configure the Gitea server in a way, that attachments and pictures are processed and served correctly. There is localhost:3000 in the links everywhere, instead of the .onion domain. I already noticed this earlier during the registration process and the emails coming from Gitea. Maybe someone can get hands-on with it and have a look at the config again. As you probably can see above, it's very crippling.

... also, if it is not asked too much, it would be very helpful to configure the Gitea server in a way, that attachments and pictures are processed and served correctly. There is `localhost:3000` in the links everywhere, instead of the .onion domain. I already noticed this earlier during the registration process and the emails coming from Gitea. Maybe someone can get hands-on with it and have a look at the config again. As you probably can see above, it's very crippling.
Author
Contributor

I investigated further: the errors are already happening when building the RoninOS image. So nothing is there for the plug'n'play setup to serve later.

 $ next build
 ▲ Next.js 16.2.4 (Turbopack)

   Creating an optimized production build ...

 > Build error occurred
 Error: Turbopack build failed with 34 errors:
 ./src/app/favicon.ico
 Processing image failed
 unable to decode image data

 Caused by:
 - The decoder for Bmp does not support the format features Unknown bitmap header type (size=1196314761)

There are dozens of errors; see full error list in the attached textfile.

It seems, this is happening when calling the function _install_nodejs_and_ronin_ui. Maybe a path set wrong?

My guess is, it's in here:

    # Run under ronin user so PNPM store ownership/paths match first-boot runtime
    # shellcheck disable=SC2016
    runuser --login "${OS_USERNAME}" -c '
        curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=11.1.2 sh -

        PNPM_HOME="${HOME}/.local/share/pnpm"
        PATH="${PNPM_HOME}/bin:${PATH}"
        export PNPM_HOME PATH

        pnpm runtime set node lts -g
        export NEXT_TELEMETRY_DISABLED=1

        cd "${HOME}/.ronindojo/roninui" || exit 1

        pnpm install --frozen-lockfile
        pnpm run build
    '
I investigated further: the errors are already happening when building the RoninOS image. So nothing is there for the plug'n'play setup to serve later. ``` $ next build ▲ Next.js 16.2.4 (Turbopack) Creating an optimized production build ... > Build error occurred Error: Turbopack build failed with 34 errors: ./src/app/favicon.ico Processing image failed unable to decode image data Caused by: - The decoder for Bmp does not support the format features Unknown bitmap header type (size=1196314761) ``` There are dozens of errors; see full error list in the attached textfile. It seems, this is happening when calling the function `_install_nodejs_and_ronin_ui`. Maybe a path set wrong? My guess is, it's [in here](http://2l2o5umijiwxjioxwpsvwxe6pr75tj7r5rggnl5ze256guwvtee3kpqd.onion/Ronin/monorepo/src/commit/80b800c2a00ccf7f82b99ae9dc60cbd3e4873048/roninos/scripts/install/customize-image.sh#L374): ``` # Run under ronin user so PNPM store ownership/paths match first-boot runtime # shellcheck disable=SC2016 runuser --login "${OS_USERNAME}" -c ' curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=11.1.2 sh - PNPM_HOME="${HOME}/.local/share/pnpm" PATH="${PNPM_HOME}/bin:${PATH}" export PNPM_HOME PATH pnpm runtime set node lts -g export NEXT_TELEMETRY_DISABLED=1 cd "${HOME}/.ronindojo/roninui" || exit 1 pnpm install --frozen-lockfile pnpm run build ' ```
Author
Contributor

Big change incoming here: PR#10. Maybe this issue was addressed or evaporated. Everyone should test thoroughly with #10.

Big change incoming here: [PR#10](http://2l2o5umijiwxjioxwpsvwxe6pr75tj7r5rggnl5ze256guwvtee3kpqd.onion/Ronin/monorepo/pulls/10). Maybe this issue was addressed or evaporated. Everyone should test thoroughly with #10.
Author
Contributor

It evaporated.

After entertaining myself for several days and a complete remake of my whole build environment, it now works again. As usual.

It evaporated. After entertaining myself for several days and a complete remake of my whole build environment, it now works again. As usual.

It evaporated.

After entertaining myself for several days and a complete remake of my whole build environment, it now works again. As usual.

This is where joining the matrix will be helpful. Coordination and comparing build enviros can happen at a much faster pace.

> It evaporated. > > After entertaining myself for several days and a complete remake of my whole build environment, it now works again. As usual. This is where joining the matrix will be helpful. Coordination and comparing build enviros can happen at a much faster pace.
Sign in to join this conversation.
No labels
No milestone
No assignees
2 participants
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
Ronin/monorepo#9
No description provided.