greyltc / docker-owncloud

Arch linux based docker container with owncloud
111 stars 37 forks source link

Refusing connection, brand new image & container. #95

Closed raqbit closed 8 years ago

raqbit commented 8 years ago

Hey, it's me again :P

So I got another issue. My system somehow messed up updating kernels, and I was weeks stuck with an older kernel, making docker unable to run. Now that I have the new kernel (and docker) back up and running, I installed a new fresh version of docker-owncloud using the following command:

docker run -v <config dir>:/usr/share/webapps/owncloud/config -v <data dir>:/usr/share/webapps/owncloud/data -v <cert dir>:/root/sslKeys -e TARGET_SUBDIR=/ --name oc --restart='always' -p 80:80 -p 443:443 -d l3iggs/owncloud

And for some reason owncloud is refusing the connection to both :80 and :433. I logged into the container with docker exec -i -t oc bash and ran curl http://localhost & curl https://localhost, both resulting in a curl: (7) Failed to connect to localhost port <port>: Connection refused .

I have no idea what is causing this and I'm even more confused since it is a clean image from the repo & it is (most likely) not related to the host.

Do you know what is causing this and how to fix them?

PS: Sorry for this being my 3rd issue lol

greyltc commented 8 years ago

I presume the issue is being caused by the contents of one (or more) of the the volume mounts you're making there. Please have a look at the README.md file here and try running the container following exactly the commands there. When that works, you know the baseline case is good and you can slowly start adding back in your special options to your docker command to see which one is causing you trouble.

l3iggs/owncloud tracks the very latest version of oc (9.0.2 now). Maybe the files that you're volume mapping in your command above are coming from some older version of owncloud. You can't just drop in the files/config from a previous version and expect things to work. There is a lot going on under the hood when you do a proper oc version upgrade: https://github.com/l3iggs/docker-owncloud#updating-your-owncloud-server-in-this-container

What version of oc are you coming from?

raqbit commented 8 years ago

No idea, might have to check the config files.

raqbit commented 8 years ago

The config says 9.0.1.3

raqbit commented 8 years ago

So I used the command from the readme, and it actually works! Now, the problem is, I have to downgrade (to make my volumes usable), and then upgrade again. How would I go about doing that?

greyltc commented 8 years ago

I've been tagging my containers whenever new oc versions are released for this very reason. You don't have to downgrade, just use l3iggs/owncloud:9.0.1-1 wherever you would have used l3iggs/owncloud previously.

That should get you owncloud 9.0.1.3

raqbit commented 8 years ago

I found the issue. It wasn't the version what was wrong, but the permissions of the SSL cert & key! A couple of weeks ago I replaced the files with links to the monthly regenerated certs & keys so I didn't have to copy it every month. (I use let's encrypt) This messed up the permissions and so the container didn't load properly. Now I fixed it and everything is back to normal. One question though. Do you have an idea about how I could automate the copying of the cert & key?

Thanks for your help once again!

greyltc commented 8 years ago

I'm glad the issue is solved for you!