YunoHost-Apps/kresus_ynh

Fail to upgrade to 0.16.0

Closed this issue · 15 comments

Trying to upgrade kresus_ynh gives me:
The user kresus exists, please provide his password

This seems to be an issue with the database password:
sudo --login --user=postgres PGUSER=postgres PGPASSWORD=********** psql -tAc 'SELECT rolname FROM pg_roles WHERE rolname='\''kresus'\'';'

Full log here: https://paste.yunohost.org/raw/yosusuqija

Hi,

it looks like the database already exists but the password was not stored. Can you run yunohost app setting kresus psqlpwd and tell me if that outputs a random string (the db password) please?

Can you also run su --command="psql -d 'kresus'" postgres <<< "\dt;" and give me the output please?

Hi,
Thanks for your help!

it looks like the database already exists but the password was not stored. Can you run yunohost app setting kresus psqlpwd and tell me if that outputs a random string (the db password) please?
Indeed, there is no password there (no output)

Can you also run su --command="psql -d 'kresus'" postgres <<< "\dt;" and give me the output please?

Did not find any relations.```

What about su - postgres --command="psql -d 'kresus'" <<< "\dt;"?

Something went wrong with the pasted code:
su --command="psql -d 'kresus'" postgres <<< "\dt;" gives:

could not change directory to "/root": Permission denied
Did not find any relations.

And su - postgres --command="psql -d 'kresus'" <<< "\dt;" gives simply:
Did not find any relations.

Weird. It should return the tables. It's like you have a kresus database but nothing in it.
What is the result of su - postgres --command="psql" <<< "\list"?

Well, I did have a working kresus.
This command shows that the table exists…


   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 kresus    | kresus   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/kresus           +
           |          |          |             |             | kresus=C*T*c*/kresus
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | postgres=CTc/postgres+
           |          |          |             |             | =c/postgres
(4 rows)

From which version were you upgrading?
Was there a previous try or installation that failed before that one?

I'm going from 0.15.2ynh4 to 0.16.0ynh4.

I did try to upgrade several times, so maybe the initial upgrade log would give more details, but I don't know if I can get it somewhere…

Yes, the initial logs would be helpful, they might contain the database password.
What is the result of grep "KRESUS_DB_PASSWORD" /var/www/kresus/config.ini -A 3?

You can try to reset the password and set it as a setting:

su - postgres --command="psql" <<< "ALTER USER kresus WITH PASSWORD 'ASTRONGDATABASEPASSWORD';"

Then check that the password works (it might return "no relations" or something but not "Peer authentication failed"):

PGPASSWORD="ASTRONGDATABASEPASSWORD" psql -U kresus -d kresus -h localhost --port 5432 <<< "\dt;"

If it is ok then save it in settings:

yunohost app setting kresus psqlpwd -v "ASTRONGDATABASEPASSWORD"

and then retry the upgrade.

So, I made some progress:

  • config.ini did not contain any password indeed, and I was able to set one following your instructions, thanks!
  • Now the upgrade goes further but fails when installing weboob, because of:
    Package libffi was not found in the pkg-config search path.
    (full log https://paste.yunohost.org/raw/bosecujaso)
  • I fixed it by installing libffi-dev
  • now the app installation itself fails (full log: https://paste.yunohost.org/raw/iriyoqoley) and I'm stuck again…

Yeah, we're getting there!

The config.ini will be edited by the script now that it knows the password (from the setting).
I added libffi-dev to the dependencies list, thanks.

For the last error, node-expat is known to randomly throw errors. Could you try again?

I tried multiple times with no luck… until I disabled mysqld, which was using quite a lot of RAM (I'm on a raspberryPi with 1GB RAM) and it worked (with quite a few npm warnings though)!

Thanks for your help! I don't know if we can make the install process lighter for those with low-spec servers like me (running kresus works just fine though), but at least we found a missing dependency!

Ugh, kresus is not working though… I have a console message "No repository for "Account" was found. Looks like this entity is not registered in current "default" connection?".
There might be something terribly wrong with my app. Let's considered this closed and I'll try and reinstall.

Unfortunately no, this dependency is known to be heavy on build indeed.
Glad we got it working!