Jump to content

Check for Docker WebUI Port conflicts and Docker Log from UI


Recommended Posts

So I submitted this as a candidate for Fix Common Problems but I really think this is ultimately the job of the base UI.

 

Maybe I'm obtuse, stupid, or both but I just spent forever tracking down why my bridged containers that I just regenerated (due to linuxserver.io container reworks) would not start. Turns out, it was because they were defaulting to ports 80 or 8080 which are already owned.

 

Sure you say, any experienced docker user should know that is something you need to change,

BUT ... guess where that is mentioned BOLDLY in the docker config page? No where that I could find and aren't you afterall trying to make this as easy for the newbie user as possible?

 

Sure you say, but unRaid's help dialogue says the following

When the network type is set to Bridge, you will be given the option of customizing what ports the container will use. While applications may be configured to talk to a specific port by default, we can remap those to different ports on our host with Docker. This means that while three different apps may all want to use port 8000, we can map each app to a unique port on the host (e.g., 8000, 8001, and 8002). When the network type is set to Host, the container will be allowed to use any available port on your system. Additional port mappings can be created, similar to Volumes, although this is not typically necessary when working with templates as port mappings should already be specified.

BUT ...you know what it doesn't say, it doesn't say that the docker will not even start or that you need to specifically ensure there are no conflicts. It says you CAN change the mapping, it doesn't say you MUST change the mapping.

 

Sure you say, but the docker logs will tell you

Cannot start container HandBrake: Bind for 0.0.0.0:8080 failed: port is already allocated

BUT ... that is the docker log, not the system log. The only way to get to the docker log via the GUI is to generate a diagnostics log which contains the docker log and then read it. Sure you can drop to the command line but really, is that the correct solution given your push to help the newbie and keep us out of the CLI for anything but the most advanced tweaking?

 

So, I humbly suggest that unRaid GUI checks for port mapping conflicts. I think Limetech needs to do a better job of making all this very clear right in the UI, maybe even checking when the container is created and pop-up an error. If not that, then you need to do a better job of communicating the docker start-failure in the logs to make it easier for the user to identify the failure issue. Like, maybe provide webgui access to the docker log or better yet, interleave it into the system log with a toggle to show/hide like you have to errors, warning, text, etc.

 

As it is, there is literally no useful error given in the current log display. But as soon as I viewed the docker logs it was immediately apparent and my problem was solved. A newbie might not still have made the connection mind you, hence why I suggest you consider dealing with this in the Docker template config page when the docker is being created/edited and saved.

 

 

Thank you for your consideration  ;D

Link to comment

Not that I agree with duplicating host ports, (and personally, I think it should be disallowed at the GUI), but

 

LOL...that did it!  Since I was using the defaults in both dockers maybe it's a good idea to change them in the templates to not be the same?  Anyway, thanks for all of the help!

More of a dockerMan issue than binhex's.  Never really noticed, but 6.2 may stop you from duplicating ports (it at least shows you which host ports are already in use).  Regardless of which version you're running, the docker run command would have pointed out the same error through the GUI at the bottom when adding / reinstalling / editing.

I hope that duplicate ports would be allowed, but noted as an error condition when you try to start a second instance if the first is already running. I have a couple dockers running individually that use the same port, and sharing other resources. I only ever want to run one at a time for obvious reasons, but I don't want to have to change the port settings to shuffle them around to use the same host port for each.

Link to comment

Not that I agree with duplicating host ports, (and personally, I think it should be disallowed at the GUI), but

 

LOL...that did it!  Since I was using the defaults in both dockers maybe it's a good idea to change them in the templates to not be the same?  Anyway, thanks for all of the help!

More of a dockerMan issue than binhex's.  Never really noticed, but 6.2 may stop you from duplicating ports (it at least shows you which host ports are already in use).  Regardless of which version you're running, the docker run command would have pointed out the same error through the GUI at the bottom when adding / reinstalling / editing.

I hope that duplicate ports would be allowed, but noted as an error condition when you try to start a second instance if the first is already running. I have a couple dockers running individually that use the same port, and sharing other resources. I only ever want to run one at a time for obvious reasons, but I don't want to have to change the port settings to shuffle them around to use the same host port for each.

 

I think it is perfectly alright to use duplicate host ports, as long as the corresponding dockers do not run at the same time.

 

Disallowing duplicates in the GUI would make it very cumbersome to make each docker unique, when this is not required.

 

In my previous post I referred to "Show deployed host ports" which can help to determine the ports to configure, but it does not enforce anything.

 

Link to comment

I probably have a very fringe use call to still allow the GUI to have duplicate ports.  The UniFi controller app needs to run on certain ports.  I create a new docker for the beta versions to test. Stop the stable docker, and start up the beta.  I can then swap back and forth as needed.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...