500 Internal Error | 1.0 Beta

Solution:
Has been fixed in v1.0.0-beta.4
Jump to solution
50 Replies
Cakey Bot
Cakey Bot3mo ago
Thank you for submitting a support request. Depending on the volume of requests, our team should get in contact with you shortly.
⚠️ Please include the following details in your post or we may reject your request without further comment: - Log (See https://homarr.dev/docs/community/faq#how-do-i-open-the-console--log) - Operating system (Unraid, TrueNAS, Ubuntu, ...) - Exact Homarr version (eg. 0.15.0, not latest) - Configuration (eg. docker-compose, screenshot or similar. Use ``your-text`` to format) - Other relevant information (eg. your devices, your browser, ...)
❓ Frequently Asked Questions | Homarr documentation
Can I install Homarr on a Raspberry Pi?
Mx
Mx3mo ago
Same error here
Heavensong
HeavensongOP3mo ago
looks like it's trying to create /db and /redis folders
Mx
Mx3mo ago
looks like it created the appdata dir, just nothing under it
Heavensong
HeavensongOP3mo ago
the /appdata folder has "nobody" user so maybe need to use PUID and PGID? 1000 I think in Unraid for "nobody" but that's specific to me
lupine
lupine3mo ago
same error here
Mx
Mx3mo ago
> ll
total 4.0K
drwxr-xr-x 2 root root 4.0K Dec 17 16:19 appdata
> ll appdata
total 0
> ll
total 4.0K
drwxr-xr-x 2 root root 4.0K Dec 17 16:19 appdata
> ll appdata
total 0
Mine has root user
Manicraft1001
Manicraft10013mo ago
Can you try https://docs.docker.com/engine/containers/run/#user instead? The image no longer supports PUID and PGID
Docker Documentation
Running containers
Running and configuring containers with the Docker CLI
Manicraft1001
Manicraft10013mo ago
1000 should be correct for Unraid. It will depend on your system.
lupine
lupine3mo ago
uhm have to find the argument in compose
Mx
Mx3mo ago
Shouldn't default root user still work then?
Manicraft1001
Manicraft10013mo ago
services:
app:
user: 1001:1001
services:
app:
user: 1001:1001
Meierschlumpf
Meierschlumpf3mo ago
Probably not because we change the ownership of the files used to run homarr and /appdata to gid=1001 and uid=1001. So because of that it's not the same and does not work with root probably
ArcaneWater
ArcaneWater3mo ago
Okay with user i got it through this db error
Heavensong
HeavensongOP3mo ago
No description
Heavensong
HeavensongOP3mo ago
tried that with both 1000 and 1001, no joy same errors
lupine
lupine3mo ago
same here
Meierschlumpf
Meierschlumpf3mo ago
Send the raw docker command coming out of this
lupine
lupine3mo ago
services: homarr: container_name: homarr image: ghcr.io/homarr-labs/homarr:beta restart: unless-stopped user: 1001:1001 environment: - TZ=Europe/Copenhagen - "NODE_TLS_REJECT_UNAUTHORIZED: 0" volumes: - /home/homarr/appdata:/appdata - /var/run/docker.sock:/var/run/docker.sock ports: - 7575:7575 thats the compose i run
Heavensong
HeavensongOP3mo ago
``
docker run
-d
--name='homarr'
--net='farrosphere'
--pids-limit 2048
-e TZ="Europe/London"
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="farrosphere"
-e HOST_CONTAINERNAME="homarr"
-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.icon='https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/homarr.png'
-p '7575:7575/tcp'
-v '/mnt/cache/appdata/homarr/appdata':'/appdata':'rw'
-v '/var/run/docker.sock':'/var/run/docker.sock':'rw'
-u="1000" 'ghcr.io/homarr-labs/homarr:beta'
b2cb9654f8caba49ef8f80b8a808c9e109de6bea64973eaa35f6342f719cb059
docker run
-d
--name='homarr'
--net='farrosphere'
--pids-limit 2048
-e TZ="Europe/London"
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="farrosphere"
-e HOST_CONTAINERNAME="homarr"
-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.icon='https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/homarr.png'
-p '7575:7575/tcp'
-v '/mnt/cache/appdata/homarr/appdata':'/appdata':'rw'
-v '/var/run/docker.sock':'/var/run/docker.sock':'rw'
-u="1000" 'ghcr.io/homarr-labs/homarr:beta'
b2cb9654f8caba49ef8f80b8a808c9e109de6bea64973eaa35f6342f719cb059
Manicraft1001
Manicraft10013mo ago
Please use code blocks, it's incredibly messy: https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA The command is wrong, remove the = from the -u
lupine
lupine3mo ago
services:
homarr:
container_name: homarr
image: ghcr.io/homarr-labs/homarr:beta
restart: unless-stopped
user: 1001:1001
environment:
- TZ=Europe/Copenhagen
- "NODE_TLS_REJECT_UNAUTHORIZED: 0"
volumes:
- /home/homarr/appdata:/appdata
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 7575:7575
services:
homarr:
container_name: homarr
image: ghcr.io/homarr-labs/homarr:beta
restart: unless-stopped
user: 1001:1001
environment:
- TZ=Europe/Copenhagen
- "NODE_TLS_REJECT_UNAUTHORIZED: 0"
volumes:
- /home/homarr/appdata:/appdata
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 7575:7575
Mx
Mx3mo ago
fwiw, even using user 1000 (my UID) or 1001, no dice - Still failling to perms on the subdirs. (Ubuntu) :slowfrog:
Meierschlumpf
Meierschlumpf3mo ago
Can you try extra parameters -u '1001:1001'?
Heavensong
HeavensongOP3mo ago
same issue, tried -u "1001:1001" and -u '1001:1001' just in case the " or ' was important
Mx
Mx3mo ago
someone gotta hop in that public chat and screenshare lol
lupine
lupine3mo ago
cant do voice - house is sleeping 😉
Heavensong
HeavensongOP3mo ago
and with user 1000 it's even worse, don't even get a 500 error
No description
ArcaneWater
ArcaneWater3mo ago
I have the same issue now that i fixed 500 with -user 🙂 ERR_CONNECTION_REFUSED and all green in homarr logs
Manicraft1001
Manicraft10013mo ago
If there is no error, the port is probably not exposed correctly. What is your port exposure?
ArcaneWater
ArcaneWater3mo ago
ports: - 7575:7575
lupine
lupine3mo ago
with user: 1000:1000 i also get a connection refused 1001:1001 gets a 500
Heavensong
HeavensongOP3mo ago
okay so if I manually create db and redis folders, it does then write db.sqlite and I can create first user also, 99 is nobody, not 1000 1000 is one of the users I made for smb, 99 is the uid and 100 is the gid for 'nobody' in unraid, and if I use -u '99:100' I get the ERR_CONNECTION_REFUSED again
Mx
Mx3mo ago
# gettext is required for envsubst
RUN apk add --no-cache redis nginx bash gettext
RUN mkdir /appdata
RUN mkdir /secrets

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

RUN chown -R 1001:1001 /appdata
RUN chown -R 1001:1001 /secrets

VOLUME /appdata
VOLUME /secrets
# gettext is required for envsubst
RUN apk add --no-cache redis nginx bash gettext
RUN mkdir /appdata
RUN mkdir /secrets

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

RUN chown -R 1001:1001 /appdata
RUN chown -R 1001:1001 /secrets

VOLUME /appdata
VOLUME /secrets
No luck here
Manicraft1001
Manicraft10013mo ago
We fixed this issue by chowning the directory. But this shouldn't be required, there is definetly some issue in the docker image. It's quite late for our time zone (23:20) and we will continue to investigate this tomorrow. I recommend all people, experiencing this problem, to wait until tomorrow instead of scewing with their permissions. See you tomorrow 👋
Mx
Mx3mo ago
So - bad news https://github.com/moby/moby/issues/3206 doing VOLUME appdata is going to create the directory 'appdata' on the host as root if it doesn't exist. There is no way around that. It's created by the docker Daemon which is running as root. There is no 'automated' solution here via the dockerfile. Options - User creates directory prior to running compose - User chown's after (worse option considering it'll have failed once, and requires restarting container) - Pre-script which just mkdir's then can launch into docker compose. (Common option) This wouldn't really affect helm/K8s because it's a PVC and they do their own permissions. But for docker runtime, no solution. For docker, it's standard for directories to pre-exist with proper permissions before mounting to them. (Lots of OS projects require this, either manually, or via pre-script usually ran via curl) This is per my colleague is well versed in docker. There are some 'gotchas' like helm where this doesn't apply, like if you are using a GUi that wraps all docker commands, or has their own file perms. Otherwise, this is the summary
GitHub
Files created into a host mounted directory are owned by root user ...
When saving a file by running an application in a Docker container to an host mounted directory, that file results to be owned by the root user in the host file system. For example: docker run -v $...
Krispy
Krispy3mo ago
I just assumed permissions issues, hit terminal in the container, rain ID -u to determine what it was running as, and then just chowned the directory to match. Didn't even think if it as being a problem. Glad it's not running as root now
ArcaneWater
ArcaneWater3mo ago
Ah i see more info for ERR_CONNECTION_REFUSED i guess run.sh: line 43: can't create /etc/nginx/nginx.conf: Permission denied homarr | nginx: [alert] could not open error log file: open() "/var/lib/nginx/logs/error.log" failed (13: Permission denied) homarr | 2024/12/18 06:33:05 [warn] 19#19: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:3
Manicraft1001
Manicraft10013mo ago
Hi, another day started in our timezone and we will start to look into this again. Thanks for the patience
Meierschlumpf
Meierschlumpf3mo ago
Okay I think we fixed it, we now have a entrypoint.sh that runs as root and creates the two need directories, then changes the owner of it to the internal user and finally runs the application with the internal user. Can you try the following image out: ghcr.io/homarr-labs/homarr:fix-startup-permission-issue For me it worked on a ubuntu machine and when running ps I got the following:
PID USER TIME COMMAND
1 root 0:00 {entrypoint.sh} /bin/sh /app/entrypoint.sh sh run.sh
10 nextjs 0:00 sh run.sh
21 nextjs 0:00 nginx: master process nginx -g daemon off;
22 nextjs 0:00 redis-server *:6379
23 nextjs 0:04 node apps/tasks/tasks.cjs
24 nextjs 0:01 node apps/websocket/wssServer.cjs
25 nextjs 0:00 next-server (v14.2.20)
26 nextjs 0:00 nginx: worker process
PID USER TIME COMMAND
1 root 0:00 {entrypoint.sh} /bin/sh /app/entrypoint.sh sh run.sh
10 nextjs 0:00 sh run.sh
21 nextjs 0:00 nginx: master process nginx -g daemon off;
22 nextjs 0:00 redis-server *:6379
23 nextjs 0:04 node apps/tasks/tasks.cjs
24 nextjs 0:01 node apps/websocket/wssServer.cjs
25 nextjs 0:00 next-server (v14.2.20)
26 nextjs 0:00 nginx: worker process
lupine
lupine3mo ago
just stops with mkdir: can't create directory '/appdata/db': Permission denied
services:
homarr:
container_name: homarr
image: ghcr.io/homarr-labs/homarr:fix-startup-permission-issue
restart: unless-stopped
user: 1001:1001
environment:
# - PUID=1000
# - PGID=1000
- TZ=Europe/Copenhagen
- "NODE_TLS_REJECT_UNAUTHORIZED: 0"
volumes:
- /home/homarr/appdata:/appdata
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 7575:7575
networks:
default:
name: containers
external: true
services:
homarr:
container_name: homarr
image: ghcr.io/homarr-labs/homarr:fix-startup-permission-issue
restart: unless-stopped
user: 1001:1001
environment:
# - PUID=1000
# - PGID=1000
- TZ=Europe/Copenhagen
- "NODE_TLS_REJECT_UNAUTHORIZED: 0"
volumes:
- /home/homarr/appdata:/appdata
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 7575:7575
networks:
default:
name: containers
external: true
argh
Meierschlumpf
Meierschlumpf3mo ago
Can you remove the user flag?
lupine
lupine3mo ago
sure
Meierschlumpf
Meierschlumpf3mo ago
And maybe remove the mounted directory if it still fails
lupine
lupine3mo ago
it worked after removing the user flag 🙂
Meierschlumpf
Meierschlumpf3mo ago
Okay great 🚀
Solution
Meierschlumpf
Meierschlumpf3mo ago
Has been fixed in v1.0.0-beta.4
Manicraft1001
Manicraft10013mo ago
Hi, the other people that had this issue: Can you confirm that it has been fixed in .4?
ArcaneWater
ArcaneWater3mo ago
Not it works with removing user ! Thanks
Heavensong
HeavensongOP3mo ago
yes works for me, no user flag needed, I deleted the dir and started again on the latest beta image

Did you find this page helpful?