nextcloud bad gateway 502, i screwed up.

  • Hi All,

    So i was trying to fix some issue's before an update.

    nextcloud has been running for 3 years with no issue's.

    i opened docker and was trying to add an environmental variable. thought i could add the phone country there.

    now i'm stuck with a bad gateway 502 trying to load the page.

    would i be correct in thinking i messed up the config when i stopped nextcloud and tried to add info?

  • HackitZ

    Changed the title of the thread from “nextcloud badgateway, i screwed up.” to “nextcloud bad gateway 502, i screwed up.”.
  • post the output of the below command inside a code box (that's the </> box above.


    docker logs -f nextcloud


    (I'm assuming you nextcloud container is named nextcloud, if not substitute your container name)


    Phone country has to be added to the config.php file. It's not an environment variable.

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • Try finding it with docker ps -a. If the container is not destroyed, you will not see it by that command. If you do not see it, portainer destroeyd it in the process of building a new one.


    Does portainer display an error message, because you screwd up the stack definition and the startup does notwork?

    If you got help in the forum and want to give something back to the project click here and write up your solution for others.

  • here's the output of docker ps -a


    Code
    CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS                  
                        NAMES                                                                                                                            
    e79b21c94575        linuxserver/nextcloud:latest             "/init"                  37 hours ago        Created                                    
                        Nextcloud                                                                                                                        

    how did you install nextcloud? with the old docker-plugin or with portainer, or what?

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • i followed this guide.

    nextcloud guide

    That doesn't really tell me how you installed it. Did you use a stack in portainer, docker-compose, etc?


    And didn't you say this started when you tried to add an environment variable or something to nextcloud? How did you try to add this environment variable?

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • part of my issue is everything runs so well i rarely have to mess with anything. so in return i forget how i set everything up. i know this statement is not helpful.

    so i did two things to fix some errors before i updated nextcloud.

    one was to add

    Code
     Your web server is not properly set up to resolve "/.well-known/webfinger". Further information can be found in the documentation.
    Your web server is not properly set up to resolve "/.well-known/nodeinfo". Further information can be found in the documentation.

    I manually edited the file in windows, i know that was a mistake. i figured i could just fix the permission issue's of the .htaccess.


    I then opened docker and stopped nextcloud to add the environment variable to the default phone code. i used the info from here. Nextcloud config

    i then restarted my server.

    this is when i got the 502 error page. i then checked docker and noticed nextcloud was not starting and/or could not be edited.

    hope this explains how i messed this up.

  • So many inconsistencies here:


    First:

    nextcloud has been running for 3 years with no issue's.

    i followed this guide.

    nextcloud guide

    macom guide is 2 years old, :/


    Second:

    I manually edited the file in windows, i know that was a mistake. i figured i could just fix the permission issue's of the .htaccess

    If you DID follow that guide, you never have the need to edit .htaccess(you don't see anywhere it beeing mentioned)

    Sorry for twisting the stabbed knife but, ask before you do, ;)



    Now, to try to salvage this debacle:

    If you DID follow that guide, post here the full content of the docker-compose.yml you used (inside a code box </> )

  • But now you can get the logs of your container with


    docker logs Nextcloud (capital N)

    If you got help in the forum and want to give something back to the project click here and write up your solution for others.

  • But now you can get the logs of your container with


    docker logs Nextcloud (capital N)

    good catch. I just assumed he named it lowercase. That is probably why he got the error earlier.

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • LOL

    Yeah it felt like 3 years.

    So turns out it was running with no issue's for 2 years.

    my ignorance of editing the .htaccess file was simply that ignorance. i clicked the links to see what needed to be edited in nextcloud. and google the fixes as well, this is how i ended up editing the .htaccess file.

    as soon as i did it i released it was a mistake. but figured it would be a permission issue with the file and i could just go in and change the permissions through shellinabox or putty.

    this is when i try to add the environment variable. i added this before i fixed the permission issues.

  • my ignorance of editing the .htaccess file was simply that ignorance

    Don't worry. We all been there somehow.

    It's one more to add to the "what not todo" list, ;)


    Post what was requested to see what can be done.

  • ok my bad,

    here is the output of : docker logs -f Nextcloud


    Code
    root@MEDIA-SERVER:~# docker logs -f Nextcloud                                                                                                        
    "docker logs" requires exactly 1 argument.                                                                                                           
    See 'docker logs --help'.                                                                                                                            
                                                                                                                                                         
    Usage:  docker logs [OPTIONS] CONTAINER                                                                                                              
                                                                                                                                                         
    Fetch the logs of a container                                                                                                                        
    root@MEDIA-SERVER:~#  
  • Try docker logs -f e79b21c94575

  • Let me jump in here. The container is in state CREATED. Docker status Created means that the container has been created from the image, but it has never been started.

    This state can be achieved in this two ways.

    1. Docker container has been created using docker create command (this is done to speed up container creation).
    2. Docker container has been created using docker run but it hasn't been able to start successfully.


    lets digg into it and paste the output of docker inspect e79b21c94575 and docker restart e79b21c94575

    If you got help in the forum and want to give something back to the project click here and write up your solution for others.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!