YunoHost-Apps / hubzilla_ynh

Hubzilla Hub package for YunoHost
https://zotlabs.org/page/hubzilla/hubzilla-project
GNU General Public License v3.0
14 stars 9 forks source link

upgrade scripted ERROR #158

Closed rocky-III closed 10 months ago

rocky-III commented 11 months ago

  YNH_APP_ACTION: upgrade
  YNH_APP_BASEDIR: /var/cache/yunohost/app_tmp_work_dirs/app_2_tbd9p0
  YNH_APP_CURRENT_VERSION: 8.0~ynh1
  YNH_APP_ID: hubzilla
  YNH_APP_INSTANCE_NAME: hubzilla
  YNH_APP_INSTANCE_NUMBER: '1'
  YNH_APP_MANIFEST_VERSION: 8.6.3~ynh1
  YNH_APP_PACKAGING_FORMAT: '2.0'
  YNH_APP_UPGRADE_TYPE: UPGRADE_APP
  YNH_ARCH: arm64
  YNH_DEBIAN_VERSION: bullseye
error: An error occurred inside the app upgrade script
interface: cli
operation: app_upgrade
parent: null
related_to:
- - app
  - hubzilla
started_at: 2023-10-08 15:40:56.265507
success: false
yunohost_version: 11.2.4

upgrade did not work

https://paste.yunohost.org/raw/obinufupay

WARNING - ./upgrade: line 33: random_string: unbound variable
2023-10-08 16:43:16,665: DEBUG - ++ ynh_exit_properly
2023-10-08 16:43:16,667: DEBUG - ++ [[ upgrade =~ ^install$|^upgrade$|^restore$ ]]
2023-10-08 16:43:17,199: DEBUG - ++ exit 1
2023-10-08 16:43:18,202: ERROR - Could not upgrade hubzilla: An error occurred inside the app upgrade script

I see that the upgrade scripted was edited at that lines in August

https://github.com/YunoHost-Apps/hubzilla_ynh/commit/f503649684ac3d213c316ed4f717eda15adfb0c0

did this caused the error?

what could i try ? Thanks

anmol26s commented 11 months ago

Here we go again!!! Hi @rocky-III I replied to you on your instance, but I don't know if it reached you as your hub seems to be broken. Show me the logs. $ tail -n 50 /var/www/hubzilla/php.log

I think we are missing random_string = ynh_app_setting_get --app=$app --key=random_string in upgrade script.

Till we find the exact issue, we can try to upgrade from previous versions if it worked for you earlier. $ yunohost app upgrade -u https://github.com/YunoHost-Apps/hubzilla_ynh/tree/84e154099cd50fd9c2914040fc2672cda75cb588 hubzilla --debug

rocky-III commented 11 months ago

HI @anmol26s

So good to see you here again :-)

i finally could restore the backup... the hub is up again

but the update did not work as you can see in the log https://paste.yunohost.org/raw/obinufupay and before the changes the update did also not work for me

https://github.com/YunoHost-Apps/hubzilla_ynh/issues/151


$ tail -n 50 /var/www/hubzilla/php.log

https://paste.yunohost.org/raw/oxosunuxon

before the update i deleted the logfile php.log

anmol26s commented 11 months ago

Your error log shows warning that may be related to the php version. For now, I want to know if you have the random_string in the settings and which php version you are running Hubzilla on? Can you check settings.yml and tell me the php version and if the random_string is present?

anmol26s commented 11 months ago

You can try upgrading from my fork. My wild guess is that the application fails to upgrade because it cannot find the random_string in the upgrade script.

Don't forget to do a manual backup before upgrading.

$ yunohost app upgrade -u https://github.com/anmol26s/hubzilla-yunohost hubzilla --debug

rocky-III commented 11 months ago

in .htconfig.php i see App::$config['system']['php_path'] = '/usr/bin/php8.0';

where do i find settings.yml ?

anmol26s commented 11 months ago

$ cat /etc/yunohost/apps/hubzilla/settings.yml

anmol26s commented 11 months ago

I think latest upgrade would update you to php8.2.

Edit: Wait a minute, I don't see any php version change in .htconfig.php in upgrade script. So you might be upgraded to php8.2 but the .htconfig.php has not been updated for php8.2.

rocky-III commented 11 months ago

in /etc/yunohost/apps/hubzilla/settings.yml i see

fpm_config_dir: /etc/php/8.0/fpm phpversion: '8.0'

but there is no random_string and in .htconfig.php i see App::$config['system']['location_hash'] = '';

so it is missing... can i just create one manually ?

anmol26s commented 11 months ago

I don't think that is a good idea. We should ask on the Hubzilla forum if it would break anything. For now you should keep this black. Try to upgrade and see if things still work.

rocky-III commented 11 months ago
 yunohost app upgrade -u https://github.com/anmol26s/hubzilla-yunohost hubzilla --debug                                                      
337  DEBUG initializing base actions map parser for cli
341  DEBUG loading actions map
344  DEBUG building parser...
369  DEBUG building parser took 0.025s
372  DEBUG acquiring lock...
396  DEBUG lock has been acquired
433  DEBUG loading python module yunohost.app took 0.036s
433  DEBUG processing action [85923.1]: yunohost.app.upgrade with args={'app': ['hubzilla'], 'url': 'https://github.com/anmol26s/hubzilla-yunohost', 'f
ile': None, 'force': False, 'no_safety_backup': False, 'continue_on_failure': False}                                                                   
819  INFO Now upgrading hubzilla...
941  DEBUG initializing ldap interface
1087 ERROR https://github.com/anmol26s/hubzilla-yunohost is not a valid app url: app url are expected to look like https://domain.tld/path/to/repo_ynh
1088 DEBUG action [85923.1] executed in 0.654s
1088 DEBUG lock has been released
1089 ERROR Unknown app
root@my:~# yunohost app upgrade hubzilla -u https://github.com/anmol26s/hubzilla-yunohost --debug                                                      
278  DEBUG initializing base actions map parser for cli
281  DEBUG loading actions map
284  DEBUG building parser...
309  DEBUG building parser took 0.025s
311  DEBUG acquiring lock...
335  DEBUG lock has been acquired
362  DEBUG loading python module yunohost.app took 0.026s
362  DEBUG processing action [86917.1]: yunohost.app.upgrade with args={'app': ['hubzilla'], 'url': 'https://github.com/anmol26s/hubzilla-yunohost', 'f
ile': None, 'force': False, 'no_safety_backup': False, 'continue_on_failure': False}                                                                   
696  INFO Now upgrading hubzilla...
802  DEBUG initializing ldap interface
939  ERROR https://github.com/anmol26s/hubzilla-yunohost is not a valid app url: app url are expected to look like https://domain.tld/path/to/repo_ynh
940  DEBUG action [86917.1] executed in 0.577s
940  DEBUG lock has been released
941  ERROR Unknown app
rocky-III commented 11 months ago

sudo yunohost app upgrade hubzilla -u https://github.com/anmol26s/hubzilla-yunohost/tree/master --debug

or

yunohost app upgrade -u https://github.com/anmol26s/hubzilla-yunohost/tree/master hubzilla --debug

does also not work :-(

What your i try?

anmol26s commented 11 months ago

So YunoHost now checks the url link to follow a certain format. I changed the repo name. You can try this. $ yunohost app upgrade -u https://github.com/anmol26s/hubzilla_ynh hubzilla --debug

rocky-III commented 10 months ago

THANKS - yes that worked

there was one issue still... no post were going out

i had to change

App::$config['system']['php_path'] = '/usr/bin/php8.0'; to App::$config['system']['php_path'] = '/usr/bin/php8.2'; manually in .htconfig.php and now things seam to work just fine :-)

Thank you so much for helping me !!

Now i have one other hub running right now on hz 8.4.2 and i had problem to update this hub also

https://github.com/YunoHost-Apps/hubzilla_ynh/issues/153

do you think i shell give it a other try with your updated version?

anmol26s commented 10 months ago

THANKS - yes that worked

Welcome, you communicate very well and handle things patiently.

You seem to be suggesting that there was no database username at the time of the backup. I would like to see the setting.yml for this instance too. If there is database_username, random_string and php version?

rocky-III commented 10 months ago

in setting.yml for this other HZ installation is see database: mysql db_name: hubzilla db_user: hubzilla phpversion: '8.2' and a random_string as well

rocky-III commented 10 months ago

last time the restoring of the backup did also not work

https://github.com/YunoHost-Apps/hubzilla_ynh/issues/153

anmol26s commented 10 months ago

Looks good you should take a backup and upgrade.

rocky-III commented 10 months ago

it worked -Thank you very much