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

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

Open
alanrenouf opened this issue Sep 26, 2023 · 20 comments
Open
Labels
bug Something isn't working planned To be implemented in future release

Comments

@alanrenouf
Copy link

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 alanrenouf added the bug Something isn't working label Sep 26, 2023
@tomaae
Copy link
Owner

tomaae commented Sep 26, 2023

check your ha log for errors

@alanrenouf
Copy link
Author

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 alanrenouf changed the title [Bug] [Bug] Portainer not connecting with "list index out of range;" error Sep 27, 2023
@tomaae
Copy link
Owner

tomaae commented Sep 27, 2023

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

@alanrenouf
Copy link
Author

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

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

@tomaae
Copy link
Owner

tomaae commented Sep 28, 2023

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?

@alanrenouf
Copy link
Author

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

@tomaae
Copy link
Owner

tomaae commented Sep 29, 2023

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.

@gapthorpe
Copy link

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!

@tomaae
Copy link
Owner

tomaae commented Sep 29, 2023

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.

@gapthorpe
Copy link

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

@alanrenouf
Copy link
Author

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?

@tomaae
Copy link
Owner

tomaae commented Sep 29, 2023

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.

@alanrenouf
Copy link
Author

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

@tomaae tomaae added the planned To be implemented in future release label Sep 29, 2023
@alanrenouf
Copy link
Author

Anything I can do to help with this one?

@tomaae
Copy link
Owner

tomaae commented Nov 4, 2023

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.

@tillo
Copy link

tillo commented Apr 9, 2024

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.

@SphtKr
Copy link

SphtKr commented May 30, 2024

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.

@jasonwitty
Copy link

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

@fuzzysb
Copy link

fuzzysb commented Aug 26, 2024

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

@padraignix
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working planned To be implemented in future release
Projects
None yet
Development

No branches or pull requests

8 participants