Announcement

Collapse
No announcement yet.

Can't access Espo after upgrade

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can't access Espo after upgrade

    I just tried to upgrade from 8.3.2 to 8.3.4 and now I can't access Espocrm.

    I have a local Ubuntu 22.04 server on which I was running Espocrm 8.3.2 installed with Docker.

    Today I tried to update to 8.3.4 and I seem to have killed it.

    Following the instructions I ran

    sudo docker compose pull && sudo docker compose up -d​

    This ran ok (after I removed the version statement from docker-compose.yml) but when I tried to access the site I got an 'Unable to Connect' message in the browser.

    I got called away and when I came back I tried again and it worked ok. So I assumed that it was just finishing up the first time. I did have to go into the admin console and turn the cache and cron on.

    As the install was using http not https I decided that I would try and install a certificate using

    sudo /var/www/espocrm/command.sh cert-generate​

    This returned "no such service: espocrm-certbot"

    Then I tried to access Espo again and I'm now getting a 404 Not Found error (nginx/1.27.0)

    I'm lost at this point. Can anyone help me to get this sorted?


  • #2
    Hi Gomez,

    Please tell me, do I understand correctly that you initially used a script installation? In this case, you should use the following command to upgrade your EspoCRM instance:
    Code:
    sudo /var/www/espocrm/command.sh upgrade
    And to switch from HTTP to HTTPS, you should use one of the following commands:
    Code:
    wget https://github.com/espocrm/espocrm-installer/releases/latest/download/install.sh
    sudo bash install.sh --ssl --owncertificate --domain=my-espocrm.com
    Code:
    wget https://github.com/espocrm/espocrm-installer/releases/latest/download/install.sh
    sudo bash install.sh --ssl --letsencrypt --domain=my-espocrm.com --email=email@my-domain.com

    It's all described here: https://docs.espocrm.com/administrat...tion-by-script.

    Also please show the logs of the EspoCRM instance itself and the server logs so that we can analyze the problem.​

    Comment


    • #3
      Hi lazovic

      Thanks for your reply.

      No I initially installed EspoCRM with Docker using the instructions found here - https://docs.espocrm.com/administrat.../installation/

      These are the last few entries in the instance logs -

      qlPDOFactory.php line 73 :: /var/www/html/application/Espo/ORM/PDO/MysqlPDOFactory.php(73)
      [2024-07-03 07:45:37] ERROR: (2002) Uncaught Exception PDOException: "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for espocrm-db failed: Temporary failure in name resolution" at /var/www/html/application/Espo/ORM/PDO/MysqlPDOFactory.php line 73 :: /var/www/html/application/Espo/ORM/PDO/MysqlPDOFactory.php(73)
      [2024-07-03 07:45:47] ERROR: (2002) Uncaught Exception PDOException: "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for espocrm-db failed: Temporary failure in name resolution" at /var/www/html/application/Espo/ORM/PDO/MysqlPDOFactory.php line 73 :: /var/www/html/application/Espo/ORM/PDO/MysqlPDOFactory.php(73)

      ​Which server logs do you need?

      Comment


      • #4
        Gomez,

        Please go to the folder where the docker-compose.yml file is located and enter the following commands to stop and restart the containers:
        Code:
        sudo docker compose down
        sudo docker compose up -d
        Also, please note that it will be correct to run sudo /var/www/espocrm/command.sh cert-generate​ command only if your EspoCRM instance was installed by a script.

        Comment


        • #5
          lazovic

          Sorry I gave you the wrong information, did try

          Code:
          sudo ./command.sh cert-generate
          Here's the result of

          Code:
          sudo docker compose down
          sudo docker compose up -d​
          gomez@lexx:/var/www/espocrm$ sudo docker compose up -d
          [+] Running 4/5
          ✔ Network espocrm_espocrm-network Created 0.2s
          ✔ Container espocrm-db Created 0.8s
          ✔ Container espocrm Created 0.8s
          ✔ Container espocrm-websocket Created 1.0s
          ⠋ Container espocrm-daemon Creating 1.0s
          ⠋ Container espocrm-nginx Creating 0.0s
          Error response from daemon: Conflict. The container name "/espocrm-nginx" is already in use by container "c7d4c62ad3e9458fa118cb029ac90fb1bab3ffc842322 a1c5 7bf9448d51805a8". You have to remove (or rename) that container to be able to reuse that name.

          ​Still seeing unable to connect in the browser

          Thanks for your help so far.

          Comment


          • #6
            Gomez,

            Everything indicates that you used a script installation, since you have Nginx server container. When installing with Docker Compose (as presented in the documentation), the server container is not used.

            Please tell me what output does the following command give in the CLI?
            Code:
            sudo docker ps

            Comment


            • #7
              lazovic

              It's really looking like I've screwed this up big time then! Facepalm

              sudo docker ps
              CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

              ​is all I get.

              I did make a copy of

              /var/www/espocrm/data

              before I started if that helps!

              Comment


              • #8
                Gomez,

                It's good that you made a copy of this folder, put it somewhere safe. Export the database with the following command and also place it in a safe place: https://docs.espocrm.com/administrat...o-the-sql-dump.
                It would also be a good idea to run this command for a full backup, this may also come in handy: https://docs.espocrm.com/administrat...script/#backup.

                I see two options to solve this problem.
                1. Simplified EspoCRM instance reinstallation attempt: https://docs.espocrm.com/administrat...ls-certificate
                2. Deep EspoCRM instance reinstallation, installation of a clean instance using a script with the clean option. After installation, you will need to transfer the previously copied EspoCRM files to the appropriate folder, import the database. After all the manipulations, make a rebuild: https://docs.espocrm.com/administrat...spocrm-rebuild. The reinstallation command will look like this (you can find all the passwords in the current docker-compose.yml file):
                Code:
                wget https://github.com/espocrm/espocrm-installer/releases/latest/download/install.sh
                sudo bash install.sh -y --ssl --letsencrypt --domain=my-espocrm.com --email=email@my-domain.com --db-root-password=my-password --db-password=my-password --admin-password=my-password --clean

                Comment


                • #9
                  lazovic

                  I'm afraid I've fallen at the first hurdle

                  sudo /var/www/espocrm/command.sh export-sql /home/gomez/
                  Exporting the database...
                  Error response from daemon: container e939a2d371ffba45cedf268e984b82ad64848c20ec3e004740 fd28cbdc26237a is not running
                  ERROR: Unable to export the database.

                  Comment


                  • #10
                    Gomez,

                    Can you please tell me what output you get in the CLI after using this command?
                    Code:
                    sudo /var/www/espocrm/command.sh restart

                    Comment


                    • #11
                      Gomez,

                      Try also stopping the problematic container with the following command:
                      Code:
                      sudo docker stop espocrm-nginx
                      And then run the following command:
                      Code:
                      sudo /var/www/espocrm/command.sh restart
                      ​​

                      Comment


                      • #12
                        lazovic

                        gomez@lexx:/var/www/espocrm$ sudo /var/www/espocrm/command.sh restart

                        [+] Restarting 4/4
                        ✔ Container espocrm-db Started 2.6s
                        ✔ Container espocrm Started 2.1s
                        ✔ Container espocrm-daemon Started 2.4s
                        ✔ Container espocrm-websocket Started 1.4s
                        gomez@lexx:/var/www/espocrm$

                        If it helps :-

                        sudo /var/www/espocrm/command.sh status
                        CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
                        bb3f92040277 espocrm/espocrm:fpm "docker-websocket.sh" 6 hours ago Up About a minute 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 9000/tcp espocrm-websocket
                        69ac120aa0f8 espocrm/espocrm:fpm "docker-daemon.sh" 6 hours ago Up About a minute 9000/tcp espocrm-daemon
                        814ed94df143 espocrm/espocrm:fpm "docker-entrypoint.s…" 6 hours ago Up About a minute 9000/tcp espocrm
                        e939a2d371ff mariadb:latest "docker-entrypoint.s…" 6 hours ago Restarting (1) 24 seconds ago​ espocrm-db


                        Comment


                        • #13
                          Gomez,

                          This is better, and we can try running a container for the server. In this case, it is better to use the following commands:
                          Code:
                          sudo /var/www/espocrm/command.sh stop
                          sudo /var/www/espocrm/command.sh start

                          You can also attach the docker-compose.yml file you are using, it will be helpful.​

                          Comment


                          • #14
                            lazovic

                            sudo /var/www/espocrm/command.sh stop

                            [+] Running 5/5
                            ✔ Container espocrm-websocket Removed 11.5s
                            ✔ Container espocrm-daemon Removed 11.5s
                            ✔ Container espocrm Removed 0.9s
                            ✔ Container espocrm-db Removed 0.2s
                            ✔ Network espocrm_espocrm-network Removed 0.3s

                            gomez@lexx:/var/www/espocrm$ sudo /var/www/espocrm/command.sh start

                            [+] Running 4/5
                            ✔ Network espocrm_espocrm-network Created 0.2s
                            ✔ Container espocrm-db Created 0.9s
                            ✔ Container espocrm Created 0.7s
                            ✔ Container espocrm-websocket Created 0.8s
                            ⠏ Container espocrm-daemon Creating 0.8s
                            ⠋ Container espocrm-nginx Creating 0.0s
                            Error response from daemon: Conflict. The container name "/espocrm-nginx" is already in use by container "c7d4c62ad3e9458fa118cb029ac90fb1bab3ffc842322 a1c5 7bf9448d51805a8". You have to remove (or rename) that container to be able to reuse that name.

                            Attached Files

                            Comment


                            • #15
                              Hola Hi Gomez, me pasó lo mismo cuando actualicé a la versión 8.3 sin hacer antes un sql-dump (ahora está la posibilidad en command.sh de ejecutar "export-sql") y se me corrompió la DB y no pude recuperarla. Mi error fue intentar actualizar primero desde la administración del crm, con un paquete zip. Seguramente por algún timeout fallo la actualización, y aunque pude actualizar con command.sh, el container de mysql quedó reiniciando sin poder conectarme.

                              Comment

                              Working...
                              X