Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portainer's use of port 9000 clashes with OS5's use of http://127.0.0.1:9000/rpc #93

Open
Myron-S opened this issue May 5, 2021 · 8 comments

Comments

@Myron-S
Copy link
Contributor

Myron-S commented May 5, 2021

Connected to Docker.

I was wondering why it was taking forever for the OS5 to recognise USB connected storage and even unmounting USB storage.

Reason is that as portainer grabs TCP port 9000, when OS5 tries to access http://127.0.0.1:9000/rpc using wget, it always fails.

I have managed to get round this issue by removing the container the installed portainer is and re-installing using the update_portainer.sh script in the Nas_Progs/docker directory, but alter the docker run command to use a different port. I opted to use port 9006 as it seems to be unused.

Is there any way to change port assignments without having to stop and remove the docker container hosting portainer/?

/shares/Volume_1/Nas_Prog/docker/update_portainer.sh:

#!/bin/sh

# Define APKG_PATH
APKG_PATH="/shares/Volume_1/Nas_Prog"

# Stop and remove the old container
docker stop portainer-ce
docker rm portainer-ce

# Download the latest container build from dockerhub
docker pull portainer/portainer-ce

# Instantiate the new container
docker run -d -p 9006:9000 --restart always --name portainer -v /var/run/docker.sock:/var/run/docker.sock -v $(readlink -f ${APKG_PATH})/portainer:/data portainer/portainer-ce

# Display listing of running containers
docker ps -a

I changed 9000:9000 to 9006:9000 and also other scripts where the port 9000:9000 are located. Seems to work.

This is what happens when OS5 tried to mount and unmount USB storage when portainer is operating in it's present configuration.

root@NAS home # wget http://127.0.0.1:9000/rpc/get_option?contentdir
--2021-05-05 13:29:00--  http://127.0.0.1:9000/rpc/get_option?contentdir
Connecting to 127.0.0.1:9000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2021-05-05 13:29:01--  (try: 2)  http://127.0.0.1:9000/rpc/get_option?contentdir
Connecting to 127.0.0.1:9000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2021-05-05 13:29:03--  (try: 3)  http://127.0.0.1:9000/rpc/get_option?contentdir
Connecting to 127.0.0.1:9000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2021-05-05 13:29:06--  (try: 4)  http://127.0.0.1:9000/rpc/get_option?contentdir
Connecting to 127.0.0.1:9000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2021-05-05 13:29:10--  (try: 5)  http://127.0.0.1:9000/rpc/get_option?contentdir
Connecting to 127.0.0.1:9000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

^C
root@NAS home #
@Myron-S Myron-S changed the title Portainer's use of pot 9000 clashes with OS5's use of http://127.0.0.1:9000/rpc Portainer's use of port 9000 clashes with OS5's use of http://127.0.0.1:9000/rpc May 5, 2021
@Myron-S
Copy link
Contributor Author

Myron-S commented May 5, 2021

Solved by changing all references of -p 9000:9000 to -p 9006:9000. Being a docker newbie I removed the entire container, pulled portainer from DockerHub and ran portainer with the host. Immediate problem solved. The WD Docker app needs modifying

@JediNite
Copy link
Collaborator

I've never seen a conflict on port 9000 on my EX4100.

@Myron-S
Copy link
Contributor Author

Myron-S commented May 23, 2021

It's there. Try something...... How long does it take the EX4100 to finish getting ready a plugged in USB storage device and then also how long does it take for the USB device to be ejected?

For me both took quite a long time. As soon as I moved Portainer to another port the USB port and the drive gets installed and ejected a lot faster.

@JediNite
Copy link
Collaborator

I just plugged in a USB drive I was using on Windows into the NAS and it found it straight away and I could read the contents under "/mnt/USB/USB3_d1". Similarly with unmounting. Try running this (9000 is showing a docker-container binding to the port - portainer) :

root@WDMyCloudEX4100 mnt # netstat -anp | grep 9000
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      21251/docker-proxy
tcp        0      0 172.17.0.1:58066        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 127.0.0.1:9000          127.0.0.1:33344         TIME_WAIT   -
tcp        0      0 172.17.0.1:58086        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58082        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58078        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58090        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58074        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58096        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58070        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58058        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58062        172.17.0.2:9000         TIME_WAIT   -
tcp        0      0 172.17.0.1:58048        172.17.0.2:9000         TIME_WAIT   -
tcp6       0      0 :::9000                 :::*                    LISTEN      21255/docker-proxy

@Myron-S
Copy link
Contributor Author

Myron-S commented May 24, 2021

The IP in question is 127.0.0.1. What was noticeable was that the power button LED kept on blinking blue for a lone time on USB drive being plugged in or an eject request from the UI. As soon as Portainer's port was changed from 9000 to 9006 the issue was gone.

Maybe it's different on the EX4100?

@scuba-fan
Copy link

Port 9000 is in use on the PR4100 by Twonkey. Looking for fix, assistance appreciated.

@JediNite
Copy link
Collaborator

@scuba-fan,

As posted above by Myron, change the reference in "update_portainer.sh" where the port mapping is done. Myron has changed this from 9000:9000 to 9006:9000, so try something similar.

Cheers,

JediNite

@scuba-fan
Copy link

Yea. Solved over a year ago. Lol. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants