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

OCA\Circles\Service\ShareWrapperService::getShareByToken(): Argument nextcloud/server#1 ($token) must be of type string, null given, called in /circles/lib/ShareByCircleProvider.php #849

Closed
JimH44 opened this issue Nov 18, 2021 · 4 comments · Fixed by #890

Comments

@JimH44
Copy link

JimH44 commented Nov 18, 2021

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

The following information comes from the NextCloud app "Issue reporting":

Steps to reproduce

nextcloud.occ files_external:list # to show external storage. Shows:
| Mount ID | Mount Point | Storage | Authentication Type | Configuration | Options | Applicable Users | Applicable Groups |
+----------+-------------+---------+---------------------+------------------------------------+-----------------+------------------+-------------------+
| 2 | /Local | Local | None | datadir: "/home/ltadmin/LTSync" | previews: false | ltadmin | |
Do command:
nextcloud.occ files_external:verify 2

Expected behaviour

Expected a report of validity of my External storage (local)

Actual behaviour

stdout caught report of unhandled exception:
An unhandled exception has been thrown:
TypeError: OCA\Circles\Service\ShareWrapperService::getShareByToken(): Argument nextcloud/server#1 ($token) must be of type string, null given, called in /snap/nextcloud/28586/htdocs/apps/circles/lib/ShareByCircleProvider.php on line 584 and defined in /snap/nextcloud/28586/htdocs/apps/circles/lib/Service/ShareWrapperService.php:162
Stack trace:
#0 /snap/nextcloud/28586/htdocs/apps/circles/lib/ShareByCircleProvider.php(584): OCA\Circles\Service\ShareWrapperService->getShareByToken()
nextcloud/server#1 /snap/nextcloud/28586/htdocs/lib/private/Share20/Manager.php(1476): OCA\Circles\ShareByCircleProvider->getShareByToken()
nextcloud/server#2 /snap/nextcloud/28586/htdocs/apps/files_external/lib/Config/UserContext.php(75): OC\Share20\Manager->getShareByToken()
nextcloud/server#3 /snap/nextcloud/28586/htdocs/apps/files_external/lib/Config/UserPlaceholderHandler.php(37): OCA\Files_External\Config\UserContext->getUserId()
nextcloud/server#4 /snap/nextcloud/28586/htdocs/apps/files_external/lib/MountConfig.php(99): OCA\Files_External\Config\UserPlaceholderHandler->handle()
nextcloud/server#5 /snap/nextcloud/28586/htdocs/apps/files_external/lib/MountConfig.php(122): OCA\Files_External\MountConfig::substitutePlaceholdersInConfig()
nextcloud/server#6 /snap/nextcloud/28586/htdocs/apps/files_external/lib/Command/Verify.php(124): OCA\Files_External\MountConfig::getBackendStatus()
nextcloud/server#7 /snap/nextcloud/28586/htdocs/apps/files_external/lib/Command/Verify.php(79): OCA\Files_External\Command\Verify->updateStorageStatus()
nextcloud/server#8 /snap/nextcloud/28586/htdocs/3rdparty/symfony/console/Command/Command.php(255): OCA\Files_External\Command\Verify->execute()
nextcloud/server#9 /snap/nextcloud/28586/htdocs/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run()
nextcloud/server#10 /snap/nextcloud/28586/htdocs/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
nextcloud/server#11 /snap/nextcloud/28586/htdocs/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
nextcloud/server#12 /snap/nextcloud/28586/htdocs/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
nextcloud/server#13 /snap/nextcloud/28586/htdocs/lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run()
nextcloud/server#14 /snap/nextcloud/28586/htdocs/console.php(99): OC\Console\Application->run()
nextcloud/server#15 /snap/nextcloud/28586/htdocs/occ(11): require_once('...')
nextcloud/server#16 {main}

Server configuration detail

Operating system: Linux 5.11.0-40-generic nextcloud/server#44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64

Webserver: Apache (fpm-fcgi)

Database: mysql 8.0.26

PHP version:

8.0.11
Modules loaded: Core, date, libxml, openssl, pcre, zlib, bcmath, bz2, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gmp, SPL, iconv, intl, json, ldap, mbstring, pcntl, PDO, session, posix, Reflection, standard, SimpleXML, mysqlnd, exif, tokenizer, xml, xmlreader, xmlwriter, zip, pdo_mysql, cgi-fcgi, redis, Zend OPcache

Nextcloud version: 22.2.0 - 22.2.0.2

Updated from an older Nextcloud/ownCloud or fresh install: fresh install

Where did you install Nextcloud from: downloaded snap version from main nextcloud website

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.8.0
 - activity: 2.15.0
 - circles: 22.1.1
 - cloud_federation_api: 1.5.0
 - comments: 1.12.0
 - contacts: 4.0.6
 - contactsinteraction: 1.3.0
 - dashboard: 7.2.0
 - dav: 1.19.0
 - federatedfilesharing: 1.12.0
 - federation: 1.12.0
 - files: 1.17.0
 - files_external: 1.13.0
 - files_pdfviewer: 2.3.0
 - files_rightclick: 1.1.0
 - files_sharing: 1.14.0
 - files_trashbin: 1.12.0
 - files_versions: 1.15.0
 - files_videoplayer: 1.11.0
 - firstrunwizard: 2.11.0
 - guests: 2.1.0
 - issuetemplate: 0.7.0
 - logreader: 2.7.0
 - lookup_server_connector: 1.10.0
 - nextcloud_announcements: 1.11.0
 - notifications: 2.10.1
 - oauth2: 1.10.0
 - password_policy: 1.12.0
 - photos: 1.4.0
 - privacy: 1.6.0
 - provisioning_api: 1.12.0
 - recommendations: 1.1.0
 - serverinfo: 1.12.0
 - settings: 1.4.0
 - sharebymail: 1.12.0
 - support: 1.5.0
 - survey_client: 1.10.0
 - systemtags: 1.12.0
 - text: 3.3.0
 - theming: 1.13.0
 - twofactor_backupcodes: 1.11.0
 - user_status: 1.2.0
 - viewer: 1.6.0
 - weather_status: 1.2.0
 - workflowengine: 2.4.0
Disabled:
 - admin_audit
 - encryption
 - user_ldap

Configuration (config/config.php)
{
    "apps_paths": [
        {
            "path": "\/snap\/nextcloud\/current\/htdocs\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps",
            "url": "\/extra-apps",
            "writable": true
        }
    ],
    "supportedDatabases": [
        "mysql"
    ],
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "memcache.local": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0
    },
    "log_type": "file",
    "logfile": "\/var\/snap\/nextcloud\/current\/logs\/nextcloud.log",
    "logfilemode": 416,
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "files.lingtransoft.info"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "22.2.0.2",
    "overwrite.cli.url": "http:\/\/localhost",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "app_install_overwrite": [
        "issuetemplate"
    ]
}

Are you using external storage, if yes which one: local

Are you using encryption:

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Chrome/95.0.4638.69

Operating system:

Logs

Web server error log
Insert your web server log here 
Nextcloud log
Insert your Nextcloud log here
Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

I hope you can work out the issue.
I deleted some of the standard template that seemed to have been covered by the nextcloud Issue template.

Jim

Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.
No errors have been found.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@szaimen szaimen transferred this issue from nextcloud/server Nov 18, 2021
@solracsf solracsf changed the title unhandled exception in occ files_external:verify OCA\Circles\Service\ShareWrapperService::getShareByToken(): Argument nextcloud/server#1 ($token) must be of type string, null given, called in /circles/lib/ShareByCircleProvider.php Nov 21, 2021
@oolongbrothers
Copy link

oolongbrothers commented Nov 22, 2021

I can confirm this on Nextcloud 22.2.3 updated from 21.0.7 today on Ubuntu 20.04.

On Nextcloud 21.0.7, the issue did not appear. I know this because I use this functionality regularly in my Ansible automation of Nextcloud external storage (which is of course bust now 😛 ).

@Simthem
Copy link

Simthem commented Dec 18, 2021

Hi,

Same issue for me :/ did you advanced .. ?

For the 22.2.3 version

TypeError: OCA\Circles\Service\ShareWrapperService::getShareByToken(): Argument #1 ($token) must be of type string, null given, called in /var/www/html/privcloud/nextcloud/apps/circles/lib/ShareByCircleProvider.php on line 584 and defined in /var/www/html/privcloud/nextcloud/apps/circles/lib/Service/ShareWrapperService.php:162
Stack trace:
#0 /var/www/html/privcloud/nextcloud/apps/circles/lib/ShareByCircleProvider.php(584): OCA\Circles\Service\ShareWrapperService->getShareByToken()
#1 /var/www/html/privcloud/nextcloud/lib/private/Share20/Manager.php(1476): OCA\Circles\ShareByCircleProvider->getShareByToken()
#2 /var/www/html/privcloud/nextcloud/apps/files_external/lib/Config/UserContext.php(75): OC\Share20\Manager->getShareByToken()
#3 /var/www/html/privcloud/nextcloud/apps/files_external/lib/Config/UserPlaceholderHandler.php(37): OCA\Files_External\Config\UserContext->getUserId()
#4 /var/www/html/privcloud/nextcloud/apps/files_external/lib/MountConfig.php(99): OCA\Files_External\Config\UserPlaceholderHandler->handle()
#5 /var/www/html/privcloud/nextcloud/apps/files_external/lib/MountConfig.php(122): OCA\Files_External\MountConfig::substitutePlaceholdersInConfig()
#6 /var/www/html/privcloud/nextcloud/apps/files_external/lib/Command/Verify.php(124): OCA\Files_External\MountConfig::getBackendStatus()
#7 /var/www/html/privcloud/nextcloud/apps/files_external/lib/Command/Verify.php(79): OCA\Files_External\Command\Verify->updateStorageStatus()
#8 /var/www/html/privcloud/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files_External\Command\Verify->execute()
#9 /var/www/html/privcloud/nextcloud/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run()
#10 /var/www/html/privcloud/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#11 /var/www/html/privcloud/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#12 /var/www/html/privcloud/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#13 /var/www/html/privcloud/nextcloud/lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run()
#14 /var/www/html/privcloud/nextcloud/console.php(99): OC\Console\Application->run()
#15 /var/www/html/privcloud/nextcloud/occ(11): require_once('...')
#16 {main}```

@oolongbrothers
Copy link

We got no attention so far, sadly. You could help it along a bit by reacting to the issue, as it says in the howto at the top:

Please use the 👍 reaction to show that you are affected by the same issue.

Fingers crossed 🙂

@ArtificialOwl
Copy link
Member

would you mind testing this? #890

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

Successfully merging a pull request may close this issue.

4 participants