Swag is not working anymore

  • Hello,

    yes, as 0 with the PUID, that works. Should I let the 0 now or change something else ?

    Thank you again,

    Harold

  • You are in business. Good news.


    I would not recommend that you run the container as root (PUID 0). This is easy to fix and will apply to other containers if/when you use them.


    The problem is permissions/ownership of the folders/files that the container creates when it first runs. You just need to change the permissions recursively on your local swag config folder ( /srv/dev-disk-by-uuid-92231eb7-e8d7-49e4-8445-0aaa5c450b26/config/swag)


    You can do this using winSCP (if you use windows) or from the cli (i.e. terminal via ssh). I would recommend you download and use winscp as it is a useful tool/application.


    From the cli you will need to run (as root so using sudo) - see below.


    Then update your stack and redeploy.


    Good luck.

    Code
    sudo chown -R 1000:100 /srv/dev-disk-by-uuid-92231eb7-e8d7-49e4-8445-0aaa5c450b26/config/swag
  • I did forward the port 444 to 444 on the router. I can see the swag screen working.

    How I did edit an heimdall stack like this :

    set up the heimdall.subdomain.conf under the proxy_confs subfolder of swag like this :

    I can see the heimdall page at http://NAS-IP:81 but not by typing http://heim.anotherdomain.duckdns.org


    I do not know what is not well set up.


    Thanks,

    Harold

  • All good.


    Did you change folder owner to 1000 and the container is working?


    With your setup you need to port forward 443 to 443 on ip 192.168.0.12


    Also in your reverse proxy config I think there is a mistake. Try:


    set $upstream_proto http;

  • Yes, I did change on the first OMV system with the swag problems. It works now perfectly.


    My last message was about another OMV system (another PC).


    Thanks

  • No worries.


    If you have more than one swag docker on your network you will need to use a different port for swag and forward this to the other system


    Also check/try the change


    set $upstream_proto http;

  • I did change the line to http in the heimdall.subdomaine.conf file. Restarted the swag container.

    Also as you see in the swag yml, I specified port 444:444 which also I did opened on the router.

  • That indicates there is something wrong with your reverse proxy config file for heim. I don't use heim so I do not know to set it up.


    Have you tested access from outside your network or are you doing your testing on the lan?


    Do you have adguard or pihole on your network with any DNS re-write rules?

  • A couple of things that might help but not sure.


    1. in your swag yaml I think you need to change your port mapping to 444:443 as the container is listening on 443 (not 444).


    Code
        ports:
          - 444:443


    2. This is very minor and will not be the issue but in your heimall yaml you have 1000 as PGID and PUID. This is unusal.

  • You have also made some errors with your heimdall yaml. It would help if you read the docker docs.


    You can't just change the container port inside your yaml as the container is 'built' using this port. so you need something like this - note I have only changed the host port and this is mapped to the container port that is not changed.


    Code
        ports:
          - 81:80
          - 458:443


    Then you need to continue with this logic into your reverse proxy config - see below. Note that I am using the https port/config.


    so the connection url is https://heim.xxxx


  • Hello again,

    I have again the same problem. Thie Ip adress of my OMV system changed.

    I deployed now swag as you adviced me some weeks ago with the compose included in OMV but this does not work.

    I did formard the port 443 to 443 on my router with the UP adress of my OMV system.

    What did I do wrong ?

    Here is the my swag YML :


    The error message is :

    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; docker compose --file '/srv/dev-disk-by-uuid-a4573920-1223-409f-95b0-eb4903d28617/containers/swag/swag.yml' --env-file '/srv/dev-disk-by-uuid-a4573920-1223-409f-95b0-eb4903d28617/containers/swag/swag.env' --env-file '/srv/dev-disk-by-uuid-a4573920-1223-409f-95b0-eb4903d28617/containers/global.env' up -d 2>&1': Container swag Starting

    Error response from daemon: driver failed programming external connectivity on endpoint swag (e4d4793bcc276bae2586dc3b49492363fdb7c684800b7325b4e84892bd455193): failed to bind port 0.0.0.0:443/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use


    OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; docker compose --file '/srv/dev-disk-by-uuid-a4573920-1223-409f-95b0-eb4903d28617/containers/swag/swag.yml' --env-file '/srv/dev-disk-by-uuid-a4573920-1223-409f-95b0-eb4903d28617/containers/swag/swag.env' --env-file '/srv/dev-disk-by-uuid-a4573920-1223-409f-95b0-eb4903d28617/containers/global.env' up -d 2>&1': Container swag Starting

    Error response from daemon: driver failed programming external connectivity on endpoint swag (e4d4793bcc276bae2586dc3b49492363fdb7c684800b7325b4e84892bd455193): failed to bind port 0.0.0.0:443/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use in /usr/share/openmediavault/engined/rpc/compose.inc:693

    Stack trace:

    #0 /usr/share/php/openmediavault/rpc/serviceabstract.inc(620): OMVRpcServiceCompose->{closure}('/tmp/bgstatusbO...', '/tmp/bgoutputqA...')

    #1 /usr/share/openmediavault/engined/rpc/compose.inc(696): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))

    #2 [internal function]: OMVRpcServiceCompose->doCommand(Array, Array)

    #3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

    #4 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('doCommand', Array, Array)

    #5 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Compose', 'doCommand', Array, Array, 1)

    #6 {main}


    What is wrong with?

    Thanks,

    Harold

  • Quote

    Error response from daemon: driver failed programming external connectivity on endpoint swag (e4d4793bcc276bae2586dc3b49492363fdb7c684800b7325b4e84892bd455193): failed to bind port 0.0.0.0:443/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use in /usr/share/openmediavault/engined/rpc/compose.inc:693

    This says port 443 is already in use so swag can't start. You either have another container using port 443 or the omv interface is using port 443.


    Only one service can use the port. you need to figure out what else is using it and free it up for swag.

  • and is better to use a new bridge network ( created previosly on compose WebGUI), to use on all your other dockers, so swag can resolve names and works as expected.


    eg:


    for example i use

    Code
    TZ=Europe/Madrid

    in Variable section of compose


    and my-net is the new bridge network created on compose webgui that I use on all my containers



    You can define variables in the global section to use same values in all your dockers and write it only once:

  • Dear all,

    I don't understand what is happening. On the same system, I am trying to redeploy swag after a change of IP address, but as a first problem, I cannot recreate a working container form the stack I had working before.

    I have this error message :


    failed to deploy a stack: Container swag Creating Container swag Created Container swag Starting Error response from daemon: driver failed programming external connectivity on endpoint swag (6031375398d271be83813bc09250e6b078f3a6538e9e07b77448fab6a78d9490): failed to bind port 0.0.0.0:443/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use


    Do you have any idea about the problem ?

    Thank you very much in advance,
    Harold

  • Quote


    failed to bind port 0.0.0.0:443/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use

    Same as I said above. port 443 is in use by something else


    You need to change whatever is using port 443 to something else or change the host side of the container port bind to something else and do a port flip-flop in your router.


    Code
        ports:
          - 443:443

    This section of the compose file is the ports binding. 443:443 is host (outside container): inside container.

    you cant change the inside the container portion, but the host side (left before the ":") can be changed to remap the container to a different host port. You would then need to remap your router in the reverse direction so the internal port matches the change you made and the external port is 443.


    I personally choose to change the port on my omv and leave 443 available for the reverse proxy, but either way works.

  • Thank you for your mail. If I understand well, I changed my YML as follows:

    Code
     ports:
          - 445:443
        restart: unless-stopped

    When I try to redeploy the stack , I get :


    failed to deploy a stack: Container swag Creating Container swag Created Container swag Starting Error response from daemon: driver failed programming external connectivity on endpoint swag (7427634feb47015984e16e0bbebf5ed9d3e5b508d23a1eb6292d4ccae0cf9080): failed to bind port 0.0.0.0:445/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:445: bind: address already in use


    Meaning that port 445 is also in use ?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!