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 states its offline #196

Closed
huzzyz opened this issue Sep 17, 2022 · 19 comments
Closed

Portainer states its offline #196

huzzyz opened this issue Sep 17, 2022 · 19 comments

Comments

@huzzyz
Copy link

huzzyz commented Sep 17, 2022

I've tried just about everything, recreating the containers, starting from scratch. I have no idea why the status light appears offline. The widget below displays my running containers but above that it stays offline.

- Portainer:
    icon: portainer.png
    href: http://192.168.1.53:9000
    description: Docker Maintenance
    container: portainer
    widget:
     type: portainer
     url: http://192.168.1.53:9000
     env: 2
     key: REDACTED

Screen Shot 2022-09-17 at 14 39 41

@benphelps
Copy link
Member

You'll need to pass the docker server it's on as well, as defined in your docker.yaml file.

@huzzyz
Copy link
Author

huzzyz commented Sep 17, 2022

Sorry, done that too.

    - Portainer:
        icon: portainer.png
        href: http://192.168.1.53:9000
        description: Docker Maintenance
        container: portainer
        server: my-local-docker
        widget:
         type: portainer
         url: http://192.168.1.53:9000
         env: 2
         key: REDACTED
my-local-docker:
  socket: /var/run/docker.sock

@benphelps
Copy link
Member

Make sure you're passing the docker socket through to your homepage container, as shown in the wiki: https://github.com/benphelps/homepage/wiki/Docker-Integration#configuration

@huzzyz
Copy link
Author

huzzyz commented Sep 17, 2022

Already have.

@colutti
Copy link

colutti commented Sep 17, 2022

Same thing here.

This is from the services file:

image

From my docker-compose:

image

image

My docker.yaml:

image

The results:

image

@C8opmBM
Copy link

C8opmBM commented Sep 17, 2022

I am having the exact issue on all containers (Status offline)

  homepage:
    <<: *internalbase
    image: ghcr.io/benphelps/homepage:latest
    user: 1001:100 # Optional, change to your user and group IDs for permissions
    volumes:
      - /srv/dev-disk-by-label-downloads/mediatools/homepage:/app/config
      - /srv/dev-disk-by-label-downloads/mediatools/homepage/icons:/app/public/icons
      - /srv/dev-disk-by-label-downloads/mediatools/homepage/images:/app/public/images
      - /srv/dev-disk-by-label-Media:/hdd1
      - /srv/dev-disk-by-label-Media2:/hdd2
      - /var/run/docker.sock:/var/run/docker.sock # This passes your local docker socket to the container
    ports:
      - 3000:3000
    container_name: homepage
# For configuration options and examples, please see:
# https://github.com/benphelps/homepage/wiki/Docker-Integration

#my-docker:
#  host: 127.0.0.1
#  port: 2375

#other-docker:
#  socket: /var/run/docker.sock

local:
  socket: /var/run/docker.sock
- Utilities:
    - Media Portainer:
        icon: portainer.png
        href: http://192.168.1.151:9000/#!/2/docker/dashboard
        server: local
        container: portainer
        description: Container management
        widget:
          type: portainer
          url: http://192.168.1.151:9000
          env: 2
          key: REDACTED

111

@colutti
Copy link

colutti commented Sep 17, 2022

Can confirm that is not a problem only with portainer. It happens to all containers.

@hunkyn
Copy link
Contributor

hunkyn commented Sep 17, 2022

I am having the exact issue on all containers (Status offline)

  homepage:
    <<: *internalbase
    image: ghcr.io/benphelps/homepage:latest
    user: 1001:100 # Optional, change to your user and group IDs for permissions
    volumes:
      - /srv/dev-disk-by-label-downloads/mediatools/homepage:/app/config
      - /srv/dev-disk-by-label-downloads/mediatools/homepage/icons:/app/public/icons
      - /srv/dev-disk-by-label-downloads/mediatools/homepage/images:/app/public/images
      - /srv/dev-disk-by-label-Media:/hdd1
      - /srv/dev-disk-by-label-Media2:/hdd2
      - /var/run/docker.sock:/var/run/docker.sock # This passes your local docker socket to the container
    ports:
      - 3000:3000
    container_name: homepage
# For configuration options and examples, please see:
# https://github.com/benphelps/homepage/wiki/Docker-Integration

#my-docker:
#  host: 127.0.0.1
#  port: 2375

#other-docker:
#  socket: /var/run/docker.sock

local:
 socket: /var/run/docker.sock
- Utilities:
   - Media Portainer:
       icon: portainer.png
       href: http://192.168.1.151:9000/#!/2/docker/dashboard
       server: local
       container: portainer
       description: Container management
       widget:
         type: portainer
         url: http://192.168.1.151:9000
         env: 2
         key: REDACTED

111

Try passing the IP address for docker server and see if that helps?

@C8opmBM
Copy link

C8opmBM commented Sep 17, 2022

Can you be more specific? Where should I pass the IP?

Also I'm getting 500 error in browser and the log is printing

Failed to discover services, please check docker.yaml for errors

@C8opmBM
Copy link

C8opmBM commented Sep 17, 2022

Console output

Failed to load resource: the server responded with a status of 500 () /api/docker/status/portainer/local:1

@colutti
Copy link

colutti commented Sep 17, 2022

I am investigating the issue, with no luck so far but I do see an improvement. This code should not catch the exception, or unless it should re-raised it so we can actually see what is going on. It is not a good practice to catch exception and do nothing about it:

image

@hunkyn
Copy link
Contributor

hunkyn commented Sep 17, 2022

Can you be more specific? Where should I pass the IP?

Also I'm getting 500 error in browser and the log is printing

Failed to discover services, please check docker.yaml for errors

In the services.yaml file, where you have server: local, instead try passing the url example server: 192.168.xx.x. I tried with an alias and it did not work for me but when I passed IP it worked so it might work for you as well.

@C8opmBM
Copy link

C8opmBM commented Sep 17, 2022

I've tried to pass the ip, same error. Thanks for the suggestion.

@benphelps
Copy link
Member

I am investigating the issue, with no luck so far but I do see an improvement. This code should not catch the exception, or unless it should re-raised it so we can actually see what is going on. It is not a good practice to catch exception and do nothing about it:

image

The exception is being caught until I can properly handle formatting errors in the YAML files. As that's the primary issue and it's errors are non-helpful.

I'll pass the exception through, to help with debugging.

@benphelps
Copy link
Member

So this all probably has to do with the user your container is running as.

You can try removing the user: 1000:1000 line from your docker compose and see if that fixes it.

@C8opmBM
Copy link

C8opmBM commented Sep 17, 2022

So this all probably has to do with the user your container is running as.

You can try removing the user: 1000:1000 line from your docker compose and see if that fixes it.

Perfect! This was the issue! Removing user from docker compose fixes it.
Also this fixes for me #168

@colutti
Copy link

colutti commented Sep 17, 2022

it fixes mine too, althought I would like to know why since all my containers run using the same user as the host.

@huzzyz
Copy link
Author

huzzyz commented Sep 17, 2022

Thank you. That fixed it.

@huzzyz huzzyz closed this as completed Sep 17, 2022
Copy link
Contributor

github-actions bot commented Feb 6, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants