Atom login after upgrade 2.5.1 to 2.6.0 on Docker

57 views
Skip to first unread message

jesus.s...@gmail.com

unread,
Aug 11, 2020, 7:45:16 AM8/11/20
to AtoM Users
Hi,

I deployed an atom 2.6.0 instance on Docker, and after dropping the database, importing the original 2.5.1 and running the upgrade script, I can see the public data but I can no longer login with whatever user previously present.
Besides, creating a new user with

docker-compose exec atom php symfony tools:add-superuser --email="some...@medios.es" --password="Som3passwd" someuser

does not report any error, but the new user does not seem to work either...

Any idea what is happening here?

Jesus.

José Raddaoui

unread,
Aug 11, 2020, 2:02:07 PM8/11/20
to AtoM Users
Hi Jesus,

A lot has changed between this versions, specially the MySQL 8 upgrade but also the encoding, collation and the password hashing algorithm. I wonder if you're using the default Docker Compose environment provided in the repository and if you're doing the upgrade from the same AtoM folder. If that's the case, to be able to get to the point you are I guess you fully removed the volumes and recreated the containers.

During the upgrade task, the passwords are re-hashed based on the following "config/app.yml" settings:


This config file can be extended/overwritten in "apps/qubit/config/app.yml" and the bootstrap process avoids changing that file if it exists. It's hard to see how this could affect you but it may be worth checking those config files.

In case there is something useful, this is the "one line" command I run to import and upgrade an old database in a 2.6 instance:

docker cp /host/path/to/dump/atom_24.sql docker_percona_1:/atom.sql && \
docker-compose exec percona mysql -h localhost -u atom -patom_12345 -e "DROP DATABASE IF EXISTS atom;" && \
docker-compose exec percona mysql -h localhost -u atom -patom_12345 -e "CREATE DATABASE atom CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;" && \
docker-compose exec percona bash -c "mysql -h localhost -u atom -patom_12345 atom < /atom.sql" && \
docker-compose exec atom php -d memory_limit=-1 symfony tools:upgrade-sql --no-confirmation && \
docker-compose exec atom php -d memory_limit=-1 symfony search:populate

Best regards,
Radda.

jesus san miguel

unread,
Aug 12, 2020, 4:54:33 AM8/12/20
to ica-ato...@googlegroups.com

Hi José,

Yes, I am using the default Docker Compose environment provided in the repository, and as you correctly guessed, I removed the volumes and recreated the containers.
From what I can see on the database, the passwords are not being hashed:

This is on 2.6.0
mysql> select * from user;
+-------+-------------------------+-------------------------+---------------+----------------------------------+--------+
| id    | username                | email                   | password_hash | salt                             | active |
+-------+-------------------------+-------------------------+---------------+----------------------------------+--------+
|   442 | demo                    | de...@example.com        | NULL          | 73f44e597c79180390a0716a9b9f1864 |      1 |
|   443 | someuser                | som...@medios.es       | NULL          | 06d34972900e46bff5bf0c85f9342a44 |      1 |
| 52973 | Administrador           | othe...@medios.es      | NULL          | 20180299986b1af4df546b59c7f960d7 |      1 |
+-------+-------------------------+-------------------------+---------------+----------------------------------+--------+


And this is on 2.5.1:

mysql> select * from user;
+-------+-----------------------------------+--------------------------------------------+------------------------------------------+----------------------------------+--------+
| id    | username                          | email                                      | sha1_password                            | salt                             | active |
+-------+-----------------------------------+--------------------------------------------+------------------------------------------+----------------------------------+--------+
|   442 | demo                              | de...@example.com                           | 4e549b95c49be975998948d20062186bbe5f6cdc | 927f387d309a385bdb6c73d478cda4e3 |      1 |
|   443 | someuser                          | 
som...@medios.es                                | c13769a99f25cddba7d9edc8f3c5c15f33f3d05d | 6a428727ab88d40f6ae882c37a3f4a55 |      1 |
|   444 | UserTest                          | user...@medios.es                         | 61b5cf0134d1adad8c8354ebdbadf097689fa181 | 9a74c5901c8a800cfdde29e5c8ab5ea1 |      1 |
+-------+-----------------------------------+--------------------------------------------+------------------------------------------+----------------------------------+--------+

My settings on config/app.yml are by default:

  # Specify password_hash algorithm constant
  # See: https://www.php.net/manual/en/password.constants.php
  password_hash_algorithm: PASSWORD_ARGON2I

  # Specify password_hash algorithm options (as JSON)
  # See: https://www.php.net/manual/en/function.password-hash.php
  password_hash_algorithm_options: {"memory_cost": "2048", "time_cost": "4", "threads": "3"}

  # Maximum allowed value for full-width treeview "items per page" setting
  treeview_items_per_page_max: 10000

Best,
Jesus


--
You received this message because you are subscribed to a topic in the Google Groups "AtoM Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ica-atom-users/R4Gqkhm6jRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/1ee4561f-7720-47fe-9db2-fb735be0b2dan%40googlegroups.com.

José Raddaoui

unread,
Aug 12, 2020, 9:44:39 AM8/12/20
to AtoM Users
Hi Jesus,

It may be the base image used for the AtoM containers, I remember some issues with old Alpine versions. You could try updating that image in the host and recreating the containers:

docker pull php:7.2-fpm-alpine
docker-compose down -v
docker-compose up -d --build --force-recreate

Then import and upgrade the database with the "one line" command from above.

Best regards
Radda.

jesus san miguel

unread,
Aug 12, 2020, 12:22:21 PM8/12/20
to ica-ato...@googlegroups.com
Hi José, you were right on the spot: pulling latest php:7.2-fpm-alpine
and recreating the containers did the trick.

Best,
Jesus
> To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/f18b1f97-cb5f-4cef-98ba-7e45313e4420n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages