Portainer refused to connect error

Hello,

So as the title suggests the Development Board turns on, boots into Torizon and shows this error:

“This site can’t be reached portainer refused to connect”

Although the portainer page does not load, all other websites do.

This is on a fresh Torizon install on a new device, and was configured through the Easy Installer that came with the board.

A similar error is experienced when trying to load portainer through another computer by using the IP:9000 method. A connection using PuTTY was established with this computer, successfully giving access to the terminal. Thus the two are connected.

Worth noting is that following the guide found here allows other computers on the network to access the portainer page by using the module’s IP, but the module itself shows the same error.

Any ideas on how the problem may be resolved?

Update:

The module can access portainer when following the guide, but it needs to be accessed through another tab where the IP and port are written manually.

Running the $docker ps command shows that the original portainer keeps restarting.

Greetings @KlitosP,

Just to clarify what version of Torizon did you install? You can check by running cat /etc/issue on the device.

Also you’re seeing “This site can’t be reached portainer refused to connect” message on the display connected to the device itself?

Also based on your update I see that you were able to resolve the issue but there’s another issue of portainer restarting repeatedly. Once you let me know which version of Torizon you installed I can attempt to reproduce this issue from my side.

Best Regards,
Jeremias

Hello Jeremias,

Thank you for your response.

I’m currently running TorizonCore 4.0.0-devel-202007+build.17

Yes, the error shows up on the screen connected to the devboard.

The problem itself hasn’t been resolved. When the board turns on the same error appears. Other computers connected to the network also face the problem of being unable to connect to the initial portainer.

Excuse my wording on the update. What I meant is that when another docker container with portainer is created other computers on the network can access it just fine. The module itself can also access it using the IP:9000 address, but a new tab must be opened using CTRL+T on the keyboard for the address to be typed in manually. The main screen to which the module boots still gives the same error, even with the new portainer.

Some additional information:

  1. By using docker ps the container created on boot where portainer resides is seen to constantly restart. This might be the cause of the problem, or it might be a consequence.
  2. The module internet browser has shown different errors. These are “http://portainer:9000/ is unreachable”, “portainer’s server IP address could not be found”, and “portainer refused to connect”.

Please let me know if you need anything else.

Kind regards,
Klitos

Alright I did some tests using the same software version on the Verdin platform. I had some interesting results.

On first boot after flashing Portainer wouldn’t start up for me at all. Seemed to be a a http timeout error or something similar. On reboot Portainer than started up consistently and I was unable to recreate the timeout error.

So I can’t conclusively reproduce your issue on my side.

Let’s try this, try removing all containers running/stopped, everything. Basically docker ps -a should return nothing. After you clean the containers up try rebooting the system.

To elaborate, the Portainer container stack is managed by a systemd service called docker-compose. This service starts the container via docker-compose on a docker-compose.yml we preloaded on the file system.

If after cleaning the containers and rebooting you still have this issue, try running sudo systemctl status docker-compose. This should give us some logs about any errors that may have popped up when trying to start the Portainer container stack.

Best Regards,
Jeremias

Hello Jeremias,

I removed all containers as you asked using docker kill $(docker ps -a -q) followed by docker rm $(docker ps -a -q). This resulted in docker ps -a showing nothing.

After restarting, the problem persisted.

Something maybe of interest is that in docker-compose.yml portainer tries to access https://feeds.toradex.com/portainer//templates.json, if I’m not wrong. This site can’t be accessed by my computer or the module and gives a 404 error.

Kind regards,
Klitos

Note: Dump from sudo systemctl status docker-compose:

docker-compose.service - Docker Compose service with docker compose
Loaded: loaded (/usr/lib/systemd/system/docker-compose.service; enabled; vendor preset: enabled)
Active: active (exited) since Sun 2086-08-04 08:17:52 UTC; 2min 59s ago
Process: 4142 ExecStart=/usr/bin/docker-compose -p torizon up -d --remove-orphans (code=exited, status=0/SUCCESS)
Main PID: 4142 (code=exited, status=0/SUCCESS)

Aug 04 08:17:44 verdin-imx8mm-06612158 systemd[1]: Starting Docker Compose service with docker compose…
Aug 04 08:17:47 verdin-imx8mm-06612158 docker-compose[4142]: Creating network “torizon_default” with the default driver
Aug 04 08:17:47 verdin-imx8mm-06612158 docker-compose[4142]: Creating torizon_weston_1 …
Aug 04 08:17:48 verdin-imx8mm-06612158 docker-compose[4142]: Creating torizon_portainer_1 …
Aug 04 08:17:50 verdin-imx8mm-06612158 docker-compose[4142]: [134B blob data]
Aug 04 08:17:52 verdin-imx8mm-06612158 docker-compose[4142]: [51B blob data]
Aug 04 08:17:52 verdin-imx8mm-06612158 systemd[1]: Started Docker Compose service with docker compose.

The problem was solved by re-installing Torizon through a USB stick. The board now boots into portainer as expected and portainer does not restart.

Cheers!

Klitos

Strange guess it was just some transient issue. Well glad it works for you now, please don’t hesitate to report it the issue resurfaces later.

Best Regards,
Jeremias