-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Nextcloud Integration - often fails after HA restart #40122
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
Comments
nextcloud documentation |
Hey there @meichthys, mind taking a look at this issue as its been labeled with an integration ( |
@mwunderling Thanks for reporting this. I was also seeing this but wasn't sure if it was something others were running into as well. I'm not sure if it will help, but it may be worth tying to set your Nextcloud docker container to start before Homeassistant. (See Another question, do you run an NGINX Proxy as a HomeAssistant Add-on or as another docker container on the same host? If so, that could be causing the issue since homeassistant will start up first and try to connect to Nextcloud, but since the proxy is not running yet, it will fail like you are seeing. For this reason i've started running NGINX Proxy Manager in a separate docker host, although there may be a way to tell your homeassistant docker instance to start the NGINX Proxy Manager add-on before the homeassistant container. (All of this may be irrelevant if you're not running the standard Homeassistant install). In other words, the key is to make sure the containers are starting in the right order. The following order should work: Nextcloud > NGINX > HomeAssistant |
@meichthys thanks for the follow up. Am not yet sure this is a boot order issue....though it may be. I use Docker compose to spin up the containers. HA, Nextcloud, and Traefik2 are all controlled by the same compose file. I'll add a But, in general, I am not starting all three at the same time. More typical, Traefik & Nextcloud are already up and running (usually for days) and I'll make some config change to HA that requires a restart. Normally, I'll do this from within HA (configuration>server controls>restart). ...this was my workflow that produced the screencap in this ticket showing Nextcloud going from working to unavailable. |
Ok, i can take a closer look. I thought things were fixed for me once i moved NGINX outside of HA, but it could just be a coincidence that i haven't had the nextcloud instance disconnect again. |
It's a little hard to tell since the issue is sporadic and i haven't seen it in a while, but i think the pull request above should fix the issue. |
@mwunderling A potential fix for this has been merged into the |
Tried with APP Password, didn’t work. Tried it with my own normal password (user is in ADMIN group) didn’t work. Tried many things. http://, https:, http://:80, https://:4443 didn’t work also. https:///ocs/v2.php/apps/serverinfo/api/v1/info?format=json is working on my iMac when I do a wget on HA: wget https:///ocs/v2.php/apps/serverinfo/api/v1/info?format=json I get this error:
I use a self signed cert. Because port 80/443 is going to my HA for Letscrypt Cert. How can I let this work with self signed cert? |
@poudenes The password should work either way. The issue here is definitely the certificate. Unfortunately I haven't tested with self-signed certs. If you're familiar with python, try connecting using the nextcloudmonitor python package to see if you can make a connection with that. If not, it's probably an the 'requests' package that nextcloudmonitor uses to fetch the api endpoint. I would recommend using NGINXProxyManager to manage your certificates for various services. It's what many of us use now to avoid having to use self-signed certs. It makes things soooooo much easier and can be installed via a homeassistant add-on or easily via docker. |
Proxy manager I tried. Home assist ant was working and able to connect from outside. Nextcloud wasn't able to connect. Tried everything to let it work.... So reverted back to old situation without proxy manager |
I think i also had an issue with Nextcloud connecting from the outside, I think the issue is that Nextcloud tries to handle the SSL Certificate setup on it's own, which essentially duplicates what Proxy manager is trying to do. I was able to get it to work when i set proxy manager to redirect to the https address of nextcloud instead of the regular http address. If i get time i may try to allow an SSL bypass for the nextcloud integration. I've updated the underlying package (nextcloudmonitor) but still need to update the integration and get it merged. |
|
This issue has been resolved. Please open a new issue if you still run into problems. |
The problem
The Nextcloud Integration is properly setup and configured on my system. The integration works roughly 1/5 of the time after restart. Restarts frequently result in Nextcloud entity states showing as unavailable in the UI (see images below - an HA restart is the only difference between the 2 caps)
Environment
HA Core - Docker on QNAP NAS
Currently on latest HA Release: 0.114.4
HA & Nextcloud both run in Docker on the same device
Traceback/Error logs
Relevant Error from Log

The text was updated successfully, but these errors were encountered: