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

Unhandled exception when change group folder permissions from shell #470

Closed
giantx78 opened this issue Jun 7, 2019 · 3 comments
Closed

Comments

@giantx78
Copy link

giantx78 commented Jun 7, 2019

I tried to change permission to a groupfolder using shell command as described in the documentation using the command:

occ groupfolders:permissions 4 --user User / -- +write

But I received this error:

An unhandled exception has been thrown:
TypeError: Argument 2 passed to OCA\GroupFolders\ACL\Rule::__construct() must be of the type integer, string given, called in /var/www/html/nextcloud/apps/groupfolders/lib/Command/ACL.php on line 185 and defined in /var/www/html/nextcloud/apps/groupfolders/lib/ACL/Rule.php:48
Stack trace:
#0 /var/www/html/nextcloud/apps/groupfolders/lib/Command/ACL.php(185): OCA\GroupFolders\ACL\Rule->__construct(Object(OCA\GroupFolders\ACL\UserMapping\UserMapping), '786', 3, 1)
#1 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\GroupFolders\Command\ACL->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/html/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OCA\GroupFolders\Command\ACL), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/nextcloud/console.php(97): OC\Console\Application->run()
#8 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')

I think the command is correct.
This are my configurations:
Nextcloud 16.0.1
Groupfolders 4.0.2
Ubuntu Server 19.04
PHP 7.2.19

Thanks.

@outergod
Copy link

outergod commented Jun 24, 2019

I'm having the same issue, Nextcloud Docker nextcloud:16.0.0-apache, Groupfolders 4.0.3.

I quickly checked and the culprit seems to be

$id = $mount->getStorage()->getCache()->getId($path);

Which sets $id to a string. Parsing the string to an int using intval seems to resolve the issue.

Edit: The upstream method, Cache::getId, is supposed to return int, which means the actual bug is in Nextcloud server itself

@patricksebastien
Copy link

patricksebastien commented Aug 7, 2019

Also having this issue.
Nextcloud: 16.0.3
Groupfolder: 4.0.4

Doesn't work for --group too:
occ groupfolders:permissions groupfolderID --group myGroup theFolder -- -read
TypeError: Argument 2 passed to OCA\GroupFolders\ACL\Rule::__construct() must be of the type int, string given

So it's not possible to manage permission via shell (occ)? We need to wait for nextcloud to fix this issue?

@wiswedel
Copy link
Contributor

Since I cannot reproduce this with the latest version 4.1.5 (https://github.com/nextcloud/groupfolders/releases/tag/v4.1.5), I'm closing 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

4 participants