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

3.0.0 upgrade breaks occ #395

Closed
fasterit opened this issue Apr 24, 2019 · 15 comments
Closed

3.0.0 upgrade breaks occ #395

fasterit opened this issue Apr 24, 2019 · 15 comments

Comments

@fasterit
Copy link

# occ
An unhandled exception has been thrown:
ParseError: syntax error, unexpected '=' in /var/www/cluster4711/apps/groupfolders/lib/Command/ACL.php:150
Stack trace:
#0 /var/www/cluster4711/lib/composer/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/cluster...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('OCA\\GroupFolder...')
#2 [internal function]: spl_autoload_call('OCA\\GroupFolder...')
#3 /var/www/cluster4711/lib/private/AppFramework/Utility/SimpleContainer.php(96): ReflectionClass->__construct('OCA\\GroupFolder...')
#4 /var/www/cluster4711/lib/private/AppFramework/Utility/SimpleContainer.php(119): OC\AppFramework\Utility\SimpleContainer->resolve('OCA\\GroupFolder...')
#5 /var/www/cluster4711/lib/private/AppFramework/DependencyInjection/DIContainer.php(426): OC\AppFramework\Utility\SimpleContainer->query('OCA\\GroupFolder...')
#6 /var/www/cluster4711/lib/private/ServerContainer.php(116): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback('OCA\\GroupFolder...')
#7 /var/www/cluster4711/lib/private/Console/Application.php(219): OC\ServerContainer->query('OCA\\GroupFolder...')
#8 /var/www/cluster4711/lib/private/Console/Application.php(134): OC\Console\Application->loadCommandsFromInfoXml(Array)
#9 /var/www/cluster4711/console.php(95): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/cluster4711/occ(11): require_once('/var/www/cluster...')
```

Disabling the groupfolders app in settings makes `occ` work again.
This is on Nextcloud 15.0.7.0 (current stable).
@Nils160988
Copy link

I can confirm this bug for groupfolders 3.0.0 with NC 15.0.7 and php 7.0 on Ubuntu 16.04.

Otherwise, no further problems seem to occur with groupfolders on a first check.

@IntelligentesTierMaulApollo13
Copy link

IntelligentesTierMaulApollo13 commented Apr 25, 2019

Same for me. Need to run a files:scan, but I am unable to do so - due to the exact same error.

NC 15.0.7, PHP 7.2 7.0, Ubuntu 18.04, Groupfolders 3.0.0~~
(As it turned out the PHP version used on our server was 7.0 (and not 7.2 as stated before) - check @nuvitong 's comment below for a solution!)

@kr4z33
Copy link

kr4z33 commented Apr 25, 2019

Same on attempting maintenance mode via occ command, setup similar to Nils160988

I noticed the following line in the logs on upgrading to 3.0.0 & disabling:

[PHP] Error: Array to string conversion at [Nextcloud install location]/lib/private/App/DependencyAnalyzer.php#356

@TP75
Copy link
Contributor

TP75 commented Apr 25, 2019

I can confirm this bug for groupfolders 3.0.0 with NC 15.0.7.0 and PHP 7.0.33 on a Debian 9 server.

occ seems to get broken completely by this app version i.e. including the maintenance command.

You may take a look at Groupfolder 3.0.0. breaks occ for a workaround procedure and for a downgrade to the 2.0.4 version.

@Nils160988
Copy link

Since this seems to be a severe error because it breaks nextcloud itself, it might be a possibility to stop the delivery of version 3.0.0 for Nextcloud 15 until there is a fix.
@juliushaertl ?

@juliusknorr
Copy link
Member

Thanks for reporting. We have removed the 14/15 compatibility for the 3.0.0 release of the app store. If you have already upgraded you should follow the instructions in https://help.nextcloud.com/t/groupfolder-3-0-0-breaks-occ/52212 to restore the old version.

@fasterit
Copy link
Author

Manual fixing isn't a good solution as you have thousands of broken systems out there already.
Why not release a 3.0.1 that works with your current stable release and fix systems the way they got broken? Because these people all run updates but don't necessarily use occ until they need to fix a serious issue to then find it broken, too. I.e. Nextcloud fails for them in a moment of truth.

@juliusknorr juliusknorr pinned this issue Apr 25, 2019
@fabiomt
Copy link

fabiomt commented Apr 26, 2019

nextcloud/apps/groupfolders/lib/Command/ACL.php
On line 150 changed from this:
[$mask, $permissions] = $this->parsePermissions($permissionStrings);
To this:
[$mask, $permissions] == $this->parsePermissions($permissionStrings);

That fixed for me.

@fasterit
Copy link
Author

fasterit commented Apr 26, 2019

@juliushaertl make this ^ (if this is a correct fix) into a 3.0.1 and fix this issue for all the people affected properly?

./lib/private/Files/Storage/DAV.php: protected function parsePermissions($permissionsString) {
and
./apps/groupfolders/lib/Command/ACL.php: private function parsePermissions(array $permissions): array {

May be this can be folded into one implementation, too.

@nuvitong
Copy link

nuvitong commented Apr 27, 2019

Hi,

I think ==, i.e. a comparison, doesn't make sense, but the assignment is what the author had in mind.
It seems to me, that the shorthand syntax for symmetric array destructering, which is new since php 7.1, is not correctly recognized.

I changed the line to the alternative list() syntax, which seems to solve the issue (in my case updating the news feeds with occ).

list($mask, $permissions) = $this->parsePermissions($permissionStrings);

Alternatively you should check, if you call your occ scripts with a php version lower than 7.1, which I was doing. Changing the calling php version to 7.1 also solved the parsing error.

Kind regards,

Tobias

@TP75
Copy link
Contributor

TP75 commented Apr 28, 2019

@nuvitong

I think ==, i.e. a comparison, doesn't make sense, but the assignment is what the author had in mind.
It seems to me, that the shorthand syntax for symmetric array destructering, which is new since php 7.1, is not correctly recognized.

Thanks and the contribution looks very reasonable to me.
I will reply after testing this with NC 15.0.7.0 and PHP 7.0 in our environment.

@joergmschulz
Copy link

indeed. In my php7.0 environment the fix of nuvitong helps.

@zansystem
Copy link

Hi, also in Centos 7 with NC 15.0.7 same problem.
Removing groupfolder, resolve.

@TP75
Copy link
Contributor

TP75 commented Apr 29, 2019

Thanks again and the a.m. hotfix by @nuvitong seems to avoid the main hassle.

However, be warned there may be other issues in the groupfolders 3.0.0 code and a return to the 2.0.4 version should be a safe solution.

You may have a look into the Comparing changes of groupfolders 3.0.0 against master view in GitHub for further consideration.

@icewind1991
Copy link
Member

3.0.1 has been released for NC14/15 to fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests