Can't create superuser and other problems in UnRaid #27

Closed
opened 2025-12-28 23:24:16 +01:00 by adam · 14 comments
Owner

Originally created by @reitenth on GitHub (Feb 5, 2025).

ive tried running docker compose exec -it web python manage.py createsuperuser

and ill i get is service "web" is not running. i can get to the port with login page though

Originally created by @reitenth on GitHub (Feb 5, 2025). ive tried running `docker compose exec -it web python manage.py createsuperuser` and ill i get is `service "web" is not running.` i can get to the port with login page though
adam added the question label 2025-12-28 23:24:16 +01:00
adam closed this issue 2025-12-28 23:24:17 +01:00
Author
Owner

@eitchtee commented on GitHub (Feb 5, 2025):

If you've renamed the web service you need to replace web in the command with the name you used. For example:

services:
  web: <---- see if this is called web, if it isn't replace web in the command with the name that's here
    image: eitchtee/wygiwyh:latest

Alternatively you can use:

docker exec -it wygiwyh_server python manage.py createsuperuser

Make sure replace wygiwyh_server with your actual WYGIWYH container name (not the postgres one), the default shoud be wygiwyh_server.

If you still have problems, could you share your docker-compose.yml file? Let me know how it goes.

@eitchtee commented on GitHub (Feb 5, 2025): If you've renamed the `web` service you need to replace `web` in the command with the name you used. For example: ```yaml services: web: <---- see if this is called web, if it isn't replace web in the command with the name that's here image: eitchtee/wygiwyh:latest ``` Alternatively you can use: `docker exec -it wygiwyh_server python manage.py createsuperuser` Make sure replace `wygiwyh_server` with your actual WYGIWYH container name (not the postgres one), the default shoud be `wygiwyh_server`. If you still have problems, could you share your docker-compose.yml file? Let me know how it goes.
Author
Owner

@reitenth commented on GitHub (Feb 5, 2025):

ok im having an issue starting the container now

  web:
    image: eitchtee/wygiwyh:latest
    container_name: ${SERVER_NAME}
    command: /start-single
    network_mode: bridge
    ports:
      - ${OUTBOUND_PORT}:8000
    env_file:
      - .env
    depends_on:
      - db
    restart: unless-stopped
    labels:
      - net.unraid.docker.managed=dockerman
      - net.unraid.docker.webui=https://[IP]:[PORT:8000]
      - net.unraid.docker.icon=https://raw.githubusercontent.com/eitchtee/WYGIWYH/main/.github/img/logo.png
  db:
    image: postgres:15
    container_name: ${DB_NAME}
    network_mode: bridge
    restart: unless-stopped
    volumes:
      - /mnt/user/appdata/wygiwyh/db:/var/lib/postgresql/data/
    environment:
      - POSTGRES_USER=${SQL_USER}
      - POSTGRES_PASSWORD=${SQL_PASSWORD}
      - POSTGRES_DB=${SQL_DATABASE}
    labels:
      - net.unraid.docker.managed=dockerman
      - net.unraid.docker.icon=https://github.com/juusujanar/unraid-templates/raw/master/img/PostgreSQL-logo.png
networks: {}

keep getting error connecting in 'pool-1': [Errno -2] Name or service not known

@reitenth commented on GitHub (Feb 5, 2025): ok im having an issue starting the container now ```services: web: image: eitchtee/wygiwyh:latest container_name: ${SERVER_NAME} command: /start-single network_mode: bridge ports: - ${OUTBOUND_PORT}:8000 env_file: - .env depends_on: - db restart: unless-stopped labels: - net.unraid.docker.managed=dockerman - net.unraid.docker.webui=https://[IP]:[PORT:8000] - net.unraid.docker.icon=https://raw.githubusercontent.com/eitchtee/WYGIWYH/main/.github/img/logo.png db: image: postgres:15 container_name: ${DB_NAME} network_mode: bridge restart: unless-stopped volumes: - /mnt/user/appdata/wygiwyh/db:/var/lib/postgresql/data/ environment: - POSTGRES_USER=${SQL_USER} - POSTGRES_PASSWORD=${SQL_PASSWORD} - POSTGRES_DB=${SQL_DATABASE} labels: - net.unraid.docker.managed=dockerman - net.unraid.docker.icon=https://github.com/juusujanar/unraid-templates/raw/master/img/PostgreSQL-logo.png networks: {} ``` keep getting `error connecting in 'pool-1': [Errno -2] Name or service not known`
Author
Owner

@reitenth commented on GitHub (Feb 5, 2025):

the logs get stuck at this line a lot [17] [INFO] Booting worker with pid: 17

@reitenth commented on GitHub (Feb 5, 2025): the logs get stuck at this line a lot `[17] [INFO] Booting worker with pid: 17`
Author
Owner

@eitchtee commented on GitHub (Feb 5, 2025):

So, I managed to reproduce this using your docker-compose.

The problem seems to be related to network_mode: bridge, assuming you're using the default env variables.

The default bridge doesn't provide name resolution to containers, so the app can't communicate with your postgres instance over the container name, so you'll need to provide an IP address on the SQL_HOST env variable or, the better option, provide a user-defined network. See https://github.com/docker/compose/issues/9513 and https://stackoverflow.com/a/52418815 and https://docs.docker.com/engine/network/drivers/bridge/#differences-between-user-defined-bridges-and-the-default-bridge

@eitchtee commented on GitHub (Feb 5, 2025): So, I managed to reproduce this using your docker-compose. The problem seems to be related to `network_mode: bridge`, assuming you're using the default env variables. The default bridge doesn't provide name resolution to containers, so the app can't communicate with your postgres instance over the container name, so you'll need to provide an IP address on the SQL_HOST env variable or, the better option, provide a user-defined network. See https://github.com/docker/compose/issues/9513 and https://stackoverflow.com/a/52418815 and https://docs.docker.com/engine/network/drivers/bridge/#differences-between-user-defined-bridges-and-the-default-bridge
Author
Owner

@eitchtee commented on GitHub (Feb 5, 2025):

Also, did you manage to create the superuser or you still can't and everything else is happening together.

@eitchtee commented on GitHub (Feb 5, 2025): Also, did you manage to create the superuser or you still can't and everything else is happening together.
Author
Owner

@reitenth commented on GitHub (Feb 5, 2025):

tried with a custom network still not working.

Image Image
@reitenth commented on GitHub (Feb 5, 2025): tried with a custom network still not working. <img width="703" alt="Image" src="https://github.com/user-attachments/assets/293c5e8b-eee3-4452-8831-dd11e47c7d98" /> <img width="887" alt="Image" src="https://github.com/user-attachments/assets/cf39e074-8a50-4e11-991d-2d1d516f893c" />
Author
Owner

@eitchtee commented on GitHub (Feb 5, 2025):

The logs seem fine, no mention of the errors you mentioned previously, is it restarting infinitely or something? What isn't working?

@eitchtee commented on GitHub (Feb 5, 2025): The logs seem fine, no mention of the errors you mentioned previously, is it restarting infinitely or something? What isn't working?
Author
Owner

@reitenth commented on GitHub (Feb 5, 2025):

the webui wont load This site can’t be reached

@reitenth commented on GitHub (Feb 5, 2025): the webui wont load `This site can’t be reached`
Author
Owner

@eitchtee commented on GitHub (Feb 5, 2025):

Do you have anymore log lines after the ones you showed?

Try adding a DJANGO_ALLOWED_HOSTS env variable with a value of *.

@eitchtee commented on GitHub (Feb 5, 2025): Do you have anymore log lines after the ones you showed? Try adding a `DJANGO_ALLOWED_HOSTS` env variable with a value of `*`.
Author
Owner

@reitenth commented on GitHub (Feb 5, 2025):

already had allowed hosts to my ip.

Image Image
@reitenth commented on GitHub (Feb 5, 2025): already had allowed hosts to my ip. <img width="1372" alt="Image" src="https://github.com/user-attachments/assets/7d84e76f-4edc-4ebe-a957-7110562e53ee" /> <img width="843" alt="Image" src="https://github.com/user-attachments/assets/22c44cd9-1a44-4761-82db-250b0e0ed8f0" />
Author
Owner

@eitchtee commented on GitHub (Feb 5, 2025):

Your logs and configs looks good.

I managed to setup UnRaid on a VM just to test things out, as I've never used it. I managed to get it working on the bridge network, below are my configurations:

Image

Image

The SQL_HOST is the IP of the postgres instance

Image


One thing I found out, and it might be what's happening to you, is that if I click the WebUI button on the UnRaid UI, it redirects me to an https:// link, which obviously won't work and gave me a This site can’t be reached error, simply changing it to http:// did the trick.

Image

Image


Finally, for future reference, for a easier user creation in UnRaid just click WYGIWYH container name on UnRaid, choose Console, then type python manage.py createsuperuser on the screen that will open.

@eitchtee commented on GitHub (Feb 5, 2025): Your logs and configs looks good. I managed to setup UnRaid on a VM just to test things out, as I've never used it. I managed to get it working on the bridge network, below are my configurations: ![Image](https://github.com/user-attachments/assets/e97f5527-4b16-4eda-902e-c49fb1fbec82) ![Image](https://github.com/user-attachments/assets/866a389c-186c-462f-bbe8-00075ce19bd4) The SQL_HOST is the IP of the postgres instance ![Image](https://github.com/user-attachments/assets/071d88f4-1633-4afa-99d6-0d3f7f6b235b) --- One thing I found out, and it might be what's happening to you, is that if I click the WebUI button on the UnRaid UI, it redirects me to an `https://` link, which obviously won't work and gave me a This site can’t be reached error, simply changing it to `http://` did the trick. ![Image](https://github.com/user-attachments/assets/55923ee0-b000-4958-ab73-d9e7b7e94ce6) ![Image](https://github.com/user-attachments/assets/e9617878-6644-4ba6-9dc9-6b7d0445fa90) --- Finally, for future reference, for a easier user creation in UnRaid just click WYGIWYH container name on UnRaid, choose Console, then type `python manage.py createsuperuser` on the screen that will open.
Author
Owner

@eitchtee commented on GitHub (Feb 5, 2025):

If the problem persists, it's outside my league, and you'll need to tinker with your network settings to see what works.

Since you're getting a generic This site can’t be reached error from your browser, it's probably a network issue, i.e. the IP you're trying to access it with is not the IP you should be accessing, etc.

@eitchtee commented on GitHub (Feb 5, 2025): If the problem persists, it's outside my league, and you'll need to tinker with your network settings to see what works. Since you're getting a generic This site can’t be reached error from your browser, it's probably a network issue, i.e. the IP you're trying to access it with is not the IP you should be accessing, etc.
Author
Owner

@reitenth commented on GitHub (Feb 5, 2025):

thanks for the help, i went over everything in your file and it was indeed the https. the template in unraid has it in the advanced web ui settings instead of http. i created a superuser as well with that command. thanks

@reitenth commented on GitHub (Feb 5, 2025): thanks for the help, i went over everything in your file and it was indeed the https. the template in unraid has it in the advanced web ui settings instead of http. i created a superuser as well with that command. thanks
Author
Owner

@eitchtee commented on GitHub (Feb 5, 2025):

All good. Hope you like the app.

@eitchtee commented on GitHub (Feb 5, 2025): All good. Hope you like the app.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WYGIWYH#27