mathesar-foundation / mathesar

Web application providing an intuitive user experience to databases.
https://mathesar.org/
GNU General Public License v3.0
2.29k stars 317 forks source link

unable to upgrade to 0.1.5 #3465

Closed jeromeperez closed 4 months ago

jeromeperez commented 4 months ago

Description

When i use /etc/mathesar$ sudo docker compose -f /etc/mathesar/docker-compose.yml up --force-recreate --build service the server doesn't accept connection if i use /etc/mathesar$ sudo docker compose -f /etc/mathesar/docker-compose.yml up server is still in 0.1.4 version

Expected behavior

a functioning 0.1.5 version

To Reproduce

  1. /etc/mathesar$ sudo wget https://github.com/mathesar-foundation/mathesar/raw/0.1.5/docker-compose.yml
  2. modify docker-compose.yml to add configuration of host (-http://db.data.isem-evolution.fr, http://IP, http://127.0.0.1) postgresql (-db.data.isem-evolution.fr) and caddy (44343:443 and 8080:80)
  3. run docker-compose.yml

Environment

Additional context

/etc/mathesar$ sudo docker compose -f /etc/mathesar/docker-compose.yml up   --force-recreate --build service
[+] Running 2/2
 ✔ Container mathesar_db       Created                                                                                                                                                                                                0.0s 
 ✔ Container mathesar_service  Recreated                                                                                                                                                                                              1.1s 
Attaching to mathesar_service
mathesar_service  | Operations to perform:
mathesar_service  |   Apply all migrations: admin, auth, contenttypes, mathesar, sessions
mathesar_service  | Running migrations:
mathesar_service  |   No migrations to apply.
mathesar_service  |   Your models have changes that are not yet reflected in a migration, and so won't be applied.
mathesar_service  |   Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
mathesar_service  | Deleting 'manifest.edc58215884d.json'
mathesar_service  | Deleting 'manifest.json.gz'
.
.
.
mathesar_service  | Deleting 'assets/utils.c7180a40.cca2f0fe4fac.js.gz'
mathesar_service  | 
mathesar_service  | 191 static files copied to '/code/static', 574 post-processed.
mathesar_service  | ------------Setting up User Databases------------
mathesar_service  | [2024-02-29 11:03:16 +0000] [15] [INFO] Starting gunicorn 20.1.0
mathesar_service  | [2024-02-29 11:03:16 +0000] [15] [INFO] Listening at: http://0.0.0.0:8000 (15)
mathesar_service  | [2024-02-29 11:03:16 +0000] [15] [INFO] Using worker: sync
mathesar_service  | [2024-02-29 11:03:16 +0000] [16] [INFO] Booting worker with pid: 16

--> server doesn't accept connection connexion_impossible

jerome.perez@db:/etc/mathesar$ sudo docker compose -f /etc/mathesar/docker-compose.yml up
[sudo] Mot de passe de jerome.perez : 
[+] Running 3/0
 ✔ Container mathesar-caddy-reverse-proxy-1  Created                                                                                                                                                                                  0.0s 
 ✔ Container mathesar_db                     Running                                                                                                                                                                                  0.0s 
 ✔ Container mathesar_service                Created                                                                                                                                                                                  0.0s 
Attaching to caddy-reverse-proxy-1, mathesar_db, mathesar_service
caddy-reverse-proxy-1  | {"level":"info","ts":1709205568.238372,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
caddy-reverse-proxy-1  | {"level":"info","ts":1709205568.2404673,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
caddy-reverse-proxy-1  | {"level":"warn","ts":1709205568.2408314,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
caddy-reverse-proxy-1  | {"level":"info","ts":1709205568.2409022,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000440080"}
caddy-reverse-proxy-1  | {"level":"info","ts":1709205568.2413018,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
caddy-reverse-proxy-1  | {"level":"info","ts":1709205568.2414327,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
caddy-reverse-proxy-1  | {"level":"info","ts":1709205568.2414408,"msg":"serving initial configuration"}
caddy-reverse-proxy-1  | {"level":"warn","ts":1709205568.3272505,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/data/caddy","instance":"9d320870-d29f-4518-a47c-91614c561224","try_again":1709291968.3272488,"try_again_in":86399.999999529}
caddy-reverse-proxy-1  | {"level":"info","ts":1709205568.3411584,"logger":"tls","msg":"finished cleaning storage units"}
mathesar_service       | Operations to perform:
mathesar_service       |   Apply all migrations: admin, auth, contenttypes, mathesar, sessions
mathesar_service       | Running migrations:
mathesar_service       |   No migrations to apply.
mathesar_service       |   Your models have changes that are not yet reflected in a migration, and so won't be applied.
mathesar_service       |   Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
mathesar_service       | Deleting 'manifest.edc58215884d.json'
.
.
.
mathesar_service       | Deleting 'assets/utils.c7180a40.cca2f0fe4fac.js.gz'
mathesar_service       | 
mathesar_service       | 191 static files copied to '/code/static', 574 post-processed.
mathesar_service       | ------------Setting up User Databases------------
mathesar_service       | [2024-02-29 11:19:31 +0000] [15] [INFO] Starting gunicorn 20.1.0
mathesar_service       | [2024-02-29 11:19:31 +0000] [15] [INFO] Listening at: http://0.0.0.0:8000 (15)
mathesar_service       | [2024-02-29 11:19:31 +0000] [15] [INFO] Using worker: sync
mathesar_service       | [2024-02-29 11:19:31 +0000] [16] [INFO] Booting worker with pid: 16

--> server seems to be still in 0.1.4 version no-upgrade0 1 5

seancolsen commented 4 months ago

Thanks for reporting this, @jeromeperez. We'll have one of our maintainers look into it and see how we can help.

mathemancer commented 4 months ago

@jeromeperez The upgrade command isn't correct. You've found a mistake in our docs, thank you! It should be:

sudo docker compose -f docker-compose.yml up --pull always -d

Sorry about that; it was an oversight on our part.

Regarding your other steps, however, I'm concerned about the fact that you've pulled a fresh docker-compose.yml file.

If you change the SECRET_KEY value between runs, it could very well cause the error you're seeing.

I assume you were, but I'd like to confirm.

jeromeperez commented 4 months ago

@jeromeperez The upgrade command isn't correct. You've found a mistake in our docs, thank you! It should be:

sudo docker compose -f docker-compose.yml up --pull always -d
i rename my saved 0.1.4 file and after the  sudo docker compose -f docker-compose.yml up --pull always -d command it's ok ;-)

Sorry about that; it was an oversight on our part.

Regarding your other steps, however, I'm concerned about the fact that you've pulled a fresh docker-compose.yml file.

  • Did you already have Mathesar running on 0.1.4? From your closure of the previous issue Unable to reach server on port 8080 #3453 , it seems like you did.
  • Did you replace your other docker-compose.yml with the new one? That's not needed (and could be a problem)
  • In particular, what did you do (if you replaced it) about copying over the value of the SECRET_KEY variable?

If you change the SECRET_KEY value between runs, it could very well cause the error you're seeing.

  • When you ran and got it back working on 0.1.4, were you using the older docker-compose.yml file?

I assume you were, but I'd like to confirm.