YunoHost-Apps / searx_ynh

Searx package for YunoHost
https://searx.github.io/searx/
GNU General Public License v3.0
20 stars 17 forks source link

Upgrade error #24

Closed Josue-T closed 6 years ago

Josue-T commented 6 years ago

Hello,

I found that while I upgrade the app the is_public settings was no and not 0 or 1 because the app was installed before the commit https://github.com/YunoHost-Apps/searx_ynh/commit/a12c4b6e925023d30e04bf044f5580077a7a62e1#diff-4b1eb3dc48c4e16d49db5b42298fe654 . When this setting is not correctly the upgrade don't fail but an error is generated.

Mybe you could replace this old setting by the new if the old is set.

Here is the log part of my install :

+ app=searx
++ ynh_app_setting_get searx domain
++ sudo yunohost app setting searx domain --output-as plain --quiet
+ domain=domain.tld
++ ynh_app_setting_get searx path
++ sudo yunohost app setting searx path --output-as plain --quiet
+ path_url=/searx/
++ ynh_app_setting_get searx is_public
++ sudo yunohost app setting searx is_public --output-as plain --quiet
+ is_public=no
++ ynh_app_setting_get searx final_path
++ sudo yunohost app setting searx final_path --output-as plain --quiet
+ final_path=/opt/yunohost/searx
+ '[' no = Yes ']'
+ '[' no = No ']'
+ '[' -z /opt/yunohost/searx ']'
+ ynh_backup_before_upgrade
+ '[' '!' -e /etc/yunohost/apps/searx/scripts/backup ']'
+ backup_number=1
+ old_backup_number=2

....

+ local match_string=__FINALPATH__
+ local replace_string=/opt/yunohost/searx
+ local workfile=/etc/uwsgi/apps-available/searx.ini
+ match_string=__FINALPATH__
+ replace_string=/opt/yunohost/searx
+ match_string=__FINALPATH__
+ replace_string=/opt/yunohost/searx
+ match_string=__FINALPATH__
+ replace_string=/opt/yunohost/searx
+ sudo sed --in-place s@__FINALPATH__@/opt/yunohost/searx@g /etc/uwsgi/apps-available/searx.ini
+ systemctl restart uwsgi
+ '[' no -eq 1 ']'
Attention : ./upgrade: ligne 144 : [: no : nombre entier attendu comme expression
+ systemctl reload nginx
+ ynh_exit_properly
+ exit_code=0
+ '[' 0 -eq 0 ']'
+ exit 0
Succès ! searx a été mis à jour
Succès ! La configuration de SSOwat a été générée
Succès ! Mise à jour terminée

I also saw exactly the same issue with wordpress.

maniackcrudelis commented 6 years ago

Ok, in fact this problem is supposed to be handled by the upgrade script. https://github.com/YunoHost-Apps/searx_ynh/blob/master/scripts/upgrade#L27-L34 But... You certainly installed your app by command line, and, it's 'no' instead of 'No'... So, the upgrade script is fucked up...

Thanks for that, I'm going to fix that right now :)

PS: Do you know we have testing branches before releasing as stable. And I can see you found a lot of bugs. It could be really nice if you could tried the testing branches. So we can fix that before releasing. Our testing branches are announced on the forum

Josue-T commented 6 years ago

Ok, in fact this problem is supposed to be handled by the upgrade script. https://github.com/YunoHost-Apps/searx_ynh/blob/master/scripts/upgrade#L27-L34 But... You certainly installed your app by command line, and, it's 'no' instead of 'No'... So, the upgrade script is fucked up...

Thank you

PS: Do you know we have testing branches before releasing as stable. And I can see you found a lot of bugs. It could be really nice if you could tried the testing branches. So we can fix that before releasing. Our testing branches are announced on the forum

Yes I thought the same thing, so I will do that this next time, but I thought that it's better to use the stable release for my production instance.

maniackcrudelis commented 6 years ago

Yes I thought the same thing, so I will do that this next time, but I thought that it's better to use the stable release for my production instance.

Most of the time our testing are really stable. I use them in my production instance. So, let see if you want to try some testing. Searx for example can be easy to try there's no real risk about it. In the worst case, searx will be broken, but there's no data.

So, just to inform you. There's no problem if you prefer to use stable, I can understand that. But, really, it's really nice that you found a lot of bugs on many apps. Thanks for that ! :)

JimboJoe commented 6 years ago

We need you!