homeassistant-portainer icon indicating copy to clipboard operation
homeassistant-portainer copied to clipboard

[Bug] Portainer not connecting with "list index out of range;" error

Open alanrenouf opened this issue 1 year ago • 20 comments

Setup the HACS integration and registered my portainer but get the following error:

image

  • Home Assistant version: HA 2023.9.3
  • Portainer integration version: v1.0.2
  • Portainer software version: 2.19.1

alanrenouf avatar Sep 26 '23 21:09 alanrenouf

check your ha log for errors

tomaae avatar Sep 26 '23 23:09 tomaae

Logger: homeassistant.config_entries Source: config_entries.py:1248 First occurred: 2:36:27 PM (1 occurrences) Last logged: 2:36:27 PM

Config entry 'Portainer' for portainer integration not ready yet: list index out of range; Retrying in background

alanrenouf avatar Sep 27 '23 01:09 alanrenouf

is that only error message? if so, remove the configuration entry, enable debug and readd it again so we get some information.

tomaae avatar Sep 27 '23 04:09 tomaae

Thanks for the help, here is the log file once i enabled debug.

home-assistant_2023-09-27T19-13-02.842Z.log

alanrenouf avatar Sep 27 '23 19:09 alanrenouf

Hmm, I can see integration itself is gathering data correctly, but there are bunch of crashes related to different integrations and such. Try to fix those too, so we know its not interfering. Also, have you tried removing and readding the portainer?

tomaae avatar Sep 28 '23 08:09 tomaae

The other integrations are expected, I was just trying some things out, I removed them so here is another log file, i tried completely removing and re-adding the plugin but still doesnt work

home-assistant_2023-09-28T21-23-23.599Z.log

alanrenouf avatar Sep 28 '23 21:09 alanrenouf

I see, you are not running it on docker, seems to be kubernates? I dont have any real experience with that. Can you give me step by step info on how to deploy same type of envinroment you have? I can spin up a VM for it.

tomaae avatar Sep 29 '23 11:09 tomaae

I had the same error when I had two environments in Portainer, one being a swarm externally (which actually was empty). Removing this environment, the integration started working fine for the local one.

Thanks!

gapthorpe avatar Sep 29 '23 12:09 gapthorpe

I had the same error when I had two environments in Portainer, one being a swarm externally (which actually was empty). Removing this environment, the integration started working fine for the local one.

Thanks!

yea, its could be the same issue. but its better to open issue when you have some problem like that. integration is still in baby stages, so there are many outlier cases that need an workaround.

tomaae avatar Sep 29 '23 17:09 tomaae

Understood - it was a half finished config from a failed experiment, so was meaning to delete and just saw this same error before I did. Thought it may help if @alanrenouf has any empty or failing environments

gapthorpe avatar Sep 29 '23 17:09 gapthorpe

Understood - it was a half finished config from a failed experiment, so was meaning to delete and just saw this same error before I did. Thought it may help if @alanrenouf has any empty or failing environments

Thanks @gapthorpe appreciate the information, I only have 1 environment but this definitely looks like some response the API is giving that the code isn't expecting. @tomaae is there any way to enable debug on the GET requests?

alanrenouf avatar Sep 29 '23 17:09 alanrenouf

yes, but that is not your issue. integration was build for docker. you use kubernates which is handled differently by portainer. I need help setting up development environment for kubernates to implement it.

tomaae avatar Sep 29 '23 17:09 tomaae

@tomaae Probably best to follow something like this for a quick start: https://yashsrivastav.hashnode.dev/getting-started-with-portainer-using-kind

alanrenouf avatar Sep 29 '23 17:09 alanrenouf

Anything I can do to help with this one?

alanrenouf avatar Nov 02 '23 09:11 alanrenouf

not really, I just have very little time right now due to family issues. update for this one will probably take a bit, since this integration needs more features to be really useful and of course kubernates support.

tomaae avatar Nov 04 '23 23:11 tomaae

I have several different Kubernetes environments in my Portainer instance and I'm available for testing. Please let me know if can help in any way. While I wait, I may try to provide at least some patch to ignore any environment that is not Docker without crashing.

tillo avatar Apr 09 '24 15:04 tillo

Another with this issue. I'm running Kubernetes via microk8s on Ubuntu (Jammy)...this should be probably one of the easiest environments to build a test VM for.

Install Jammy, install microk8s (via snap) and then install the portainer add-on with microk8s enable portainer, which should give you Portainer available on port 30777. I actually run HA inside microk8s, so I'm trying to access it via portainer.portainer.svc.cluster.local:9000 , but it should work from outside the cluster at port 30777.

SphtKr avatar May 30 '24 11:05 SphtKr

@tomaae you can setup k3s on a raspberry pi for testing this, i am also available to help if needed. let me know. thanks.

jasonwitty avatar Aug 26 '24 21:08 jasonwitty

I have the same issue, i have a Portainer instance with a 9 node MicroK8s cluster and an additional 3 docker hosts and i receive this same error. happy to be a tester for any code changes

fuzzysb avatar Aug 26 '24 23:08 fuzzysb

Ran into the same issue when trying to set this up in HA. Have a docker setup in portainer, along with a k3s cluster.

padraignix avatar Aug 31 '24 17:08 padraignix