Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Fucking ugly workaround for the goddamn dependency nighmare from sury djeezus kraiste #809

Merged
merged 2 commits into from Oct 8, 2019

Conversation

alexAubin
Copy link
Member

The problem

c.f. this hell

Solution

Lol just readd the sury repo in the middle of the install_app_dependency helper if we detect that sury fucked everything and we need other php deps

PR Status

Yolo commited without any test, should be tested ...

How to test

Install pixelfed then try to install e.g. nextcloud

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :

@decentral1se
Copy link
Member

OK, thanks for facing this one down. I've gone ahead and installed pixelfed and then nextcloud on a fresh VPS with this patch applied. During the Nextcloud installation, I got the following logs:

54605 DEBUG + echo '[###########++++.....] > Installing nextcloud...'
54605 DEBUG + set -x
54605 DEBUG + chown -R nextcloud: /var/www/nextcloud /home/yunohost.app/nextcloud/data
54806 DEBUG ++ ynh_string_random --length=6
54806 DEBUG ++ local legacy_args=l
54807 DEBUG ++ args_array=([l]=length=)
54807 DEBUG ++ declare -Ar args_array
54807 DEBUG ++ local length
54807 DEBUG ++ ynh_handle_getopts_args --length=6
54807 DEBUG ++ set +x
54807 DEBUG ++ length=6
54807 DEBUG ++ sed -n 's/\(.\{6\}\).*/\1/p'
54808 DEBUG ++ tr -c -d A-Za-z0-9
54808 DEBUG ++ dd if=/dev/urandom bs=1 count=1000
54808 DEBUG + exec_occ maintenance:install --database mysql --database-name nextcloud --database-user nextcloud --database-pass RqYJ8wbZ6iKxjbwczaB24ypS --admin-user admin --admin-pass SohYkk --data-dir /home/yunohost.app/nextcloud/data
54808 DEBUG + cd /var/www/nextcloud
54808 DEBUG + exec_as nextcloud php occ --no-interaction --no-ansi maintenance:install --database mysql --database-name nextcloud --database-user nextcloud --database-pass RqYJ8wbZ6iKxjbwczaB24ypS --admin-user admin --admin-pass SohYkk --data-dir /home/yunohost.app/nextcloud/data
54808 DEBUG + local USER=nextcloud
54809 DEBUG + shift 1
54809 DEBUG ++ whoami
54809 DEBUG + [[ nextcloud = root ]]
54809 DEBUG + sudo -u nextcloud php occ --no-interaction --no-ansi maintenance:install --database mysql --database-name nextcloud --database-user nextcloud --database-pass RqYJ8wbZ6iKxjbwczaB24ypS --admin-user admin --admin-pass SohYkk --data-dir /home/yunohost.app/nextcloud/data
55010 DEBUG PHP module zip not installed.
55011 WARNING Unable to install Nextcloud
55012 DEBUG Please ask your server administrator to install the module.
55012 DEBUG 
55012 DEBUG An unhandled exception has been thrown:
55013 DEBUG Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
55013 DEBUG Stack trace:
55014 DEBUG #0 /var/www/nextcloud/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
55014 DEBUG #1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
55015 DEBUG #2 {main}+ ynh_die '--message=Unable to install Nextcloud'
55016 DEBUG + local legacy_args=mc
55016 DEBUG + args_array=([m]=message= [c]=ret_code=)
55017 DEBUG + declare -Ar args_array
55017 DEBUG + local message
55018 DEBUG + local ret_code
55018 DEBUG + ynh_handle_getopts_args '--message=Unable to install Nextcloud'
55019 DEBUG + set +x
55020 DEBUG + echo 'Unable to install Nextcloud'
55020 DEBUG + exit 1
55021 DEBUG + ynh_exit_properly
55021 DEBUG + local exit_code=1
55022 DEBUG + '[' 1 -eq 0 ']'
55022 DEBUG + trap '' EXIT
55023 DEBUG + set +eu
55023 DEBUG + sleep 0.5
55526 DEBUG + ynh_print_err '--message=!!\n  nextcloud'\''s script has encountered an error. Its execution was cancelled.\n!!'
55527 WARNING [ERR] !!
55527 DEBUG + local legacy_args=m
55527 WARNING   nextcloud's script has encountered an error. Its execution was cancelled.
55528 DEBUG + args_array=([m]=message=)
55528 WARNING !!
55528 DEBUG + declare -Ar args_array
55528 WARNING Please find here an extract of the log before the crash:
55528 DEBUG + local message
55529 WARNING [DEBUG]: DEBUG   - + local USER=nextcloud
55529 DEBUG + ynh_handle_getopts_args '--message=!!\n  nextcloud'\''s script has encountered an error. Its execution was cancelled.\n!!'
55529 WARNING [DEBUG]: DEBUG   - + shift 1
55529 DEBUG + set +x
55529 WARNING [DEBUG]: DEBUG   - ++ whoami
55530 DEBUG + ynh_print_log '\e[91m\e[1m[ERR]\e[0m !!\n  nextcloud'\''s script has encountered an error. Its execution was cancelled.\n!!'
55530 WARNING [DEBUG]: DEBUG   -
55530 DEBUG + echo -e '\e[91m\e[1m[ERR]\e[0m !!\n  nextcloud'\''s script has encountered an error. Its execution was cancelled.\n!!'
55531 WARNING [DEBUG]: DEBUG   - + sudo -u nextcloud php occ --no-interaction --no-ansi maintenance:install --database mysql --database-name nextcloud --database-user nextcloud --database-pass RqYJ8wbZ6iKxjbwczaB24ypS --admin-user admin --admin-pass SohYkk --data-dir /home/yunohost.app/nextcloud/data
55531 DEBUG + '[' cli == cli ']'
55532 WARNING [DEBUG]: DEBUG   - PHP module zip not installed.

And actually, I do not see the repository configured in my sources folder:

root@ynhdev:~# ls -lha /etc/apt/sources.list.d/
total 20K
drwxr-xr-x 2 root root 4.0K Sep 25 15:18 .
drwxr-xr-x 6 root root 4.0K Sep 24 17:11 ..
-rw-r--r-- 1 root root  243 Jul 14 06:07 hetzner-mirror.list
-rw-r--r-- 1 root root   83 Jul 14 06:07 hetzner-security-updates.list
-rw-r--r-- 1 root root   53 Sep 24 12:04 yunohost.list

And then when I tried to manually install this missing package I got:

root@ynhdev:~# apt install php7.0-zip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.0-zip : Depends: php7.0-common (= 7.0.33-0+deb9u5) but 7.0.33-11+0~20190923.20+debian9~1.gbpd05c7e is to be installed
E: Unable to correct problems, you have held broken packages.

However, once I manually added the repository, I could install nextcloud!

So, I think the conditional check just isn't being triggered ... I'll review the patch again.

@alexAubin alexAubin mentioned this pull request Oct 6, 2019
4 tasks
@alexAubin alexAubin added this to the 3.6.x milestone Oct 8, 2019
@alexAubin alexAubin merged commit c7b3f29 into stretch-unstable Oct 8, 2019
@alexAubin alexAubin deleted the ugly-sury-workaround branch October 8, 2019 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants