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

Print error message again, when 3rdparty submodule is not initialized #20

Merged
merged 1 commit into from
Jun 8, 2016

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Jun 7, 2016

  • old code used Response which attempted to use OC::$server which is not
    and cannot be intialised at this part of the code.

@LukasReschke @MorrisJobke

@blizzz blizzz added bug 3. to review Waiting for reviews labels Jun 7, 2016
@blizzz blizzz added this to the Nextcloud 9 milestone Jun 7, 2016
@LukasReschke
Copy link
Member

👍

@MorrisJobke
Copy link
Member

Tested and works 👍

- old code used Response which attempted to use OC::$server which is not
and cannot be intialised at this part of the code.
@blizzz
Copy link
Member Author

blizzz commented Jun 8, 2016

rebased

@blizzz blizzz merged commit bc8fe82 into master Jun 8, 2016
@blizzz blizzz deleted the fix-3rdparty-notice branch June 8, 2016 08:59
@MorrisJobke
Copy link
Member

MorrisJobke commented Jun 8, 2016

Also port to stable9?

MorrisJobke added a commit that referenced this pull request Nov 9, 2018
* caused by a concurrect insert that happens between the INSERT and it's sub-SELECT which was there to actually avoid it within insertIfNotExists - sub selects are not atomic and allow this
* see also #12315

Avoids an error that has this stack trace:

```
Doctrine\DBAL\Exception\UniqueConstraintViolationException

An exception occurred while executing 'INSERT INTO "oc_file_locks" ("key","lock","ttl") SELECT ?,?,? FROM "oc_file_locks" WHERE "key" = ? HAVING COUNT(*) = 0' with params ["files/737d52477f1fb583a5bfe5eb33e820da", 1, 1524066628, "files/737d52477f1fb583a5bfe5eb33e820da"]:

SQLSTATE[23505]: Unique violation: 7 ERROR:  duplicate key value violates unique constraint "lock_key_index"
DETAIL:  Key (key)=(files/737d52477f1fb583a5bfe5eb33e820da) already exists.

 #0 3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
 #1 3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1015): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOPgSql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'INSERT INTO "oc...', Array)
 #2 lib/private/DB/Connection.php(213): Doctrine\DBAL\Connection->executeUpdate('INSERT INTO "oc...', Array, Array)
 #3 lib/private/DB/Adapter.php(114): OC\DB\Connection->executeUpdate('INSERT INTO "oc...', Array)\n#4 lib/private/DB/Connection.php(251): OC\DB\Adapter->insertIfNotExist('*PREFIX*file_lo...', Array, Array)\n#5 lib/private/Lock/DBLockingProvider.php(118): OC\DB\Connection->insertIfNotExist('*PREFIX*file_lo...', Array, Array)\n#6 lib/private/Lock/DBLockingProvider.php(163): OC\Lock\DBLockingProvider->initLockField('files/737d52477...', 1)
 #7 lib/private/Files/Storage/Common.php(704): OC\Lock\DBLockingProvider->acquireLock('files/737d52477...', 1)
 #8 lib/private/Files/View.php(1931): OC\Files\Storage\Common->acquireLock('files/Documents', 1, Object(OC\Lock\DBLockingProvider))
 #9 lib/private/Files/View.php(2041): OC\Files\View->lockPath('/*******/files/...', 1, false)
 #10 lib/private/Files/Node/Node.php(360): OC\Files\View->lockFile('/*******/files/...', 1)
 #11 apps/files_sharing/lib/Controller/ShareAPIController.php(928): OC\Files\Node\Node->lock(1)
 #12 apps/files_sharing/lib/Controller/ShareAPIController.php(589): OCA\Files_Sharing\Controller\ShareAPIController->lock(Object(OC\Files\Node\Folder))
 #13 [internal function]: OCA\Files_Sharing\Controller\ShareAPIController->getShares('true', 'false', 'false', Object(OC\Files\Node\Folder), 'false')
 #14 lib/private/AppFramework/Http/Dispatcher.php(160): call_user_func_array(Array, Array)
 #15 lib/private/AppFramework/Http/Dispatcher.php(90): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Files_Sharing\Controller\ShareAPIController), 'getShares')
 #16 lib/private/AppFramework/App.php(114): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Files_Sharing\Controller\ShareAPIController), 'getShares')
 #17 lib/private/AppFramework/Routing/RouteActionHandler.php(47): OC\AppFramework\App::main('OCA\\Files_Shari...', 'getShares', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
 #18 [internal function]: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
 #19 lib/private/Route/Router.php(299): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
 #20 ocs/v1.php(78): OC\Route\Router->match('/ocsapp/apps/fi...')
 #21 ocs/v2.php(23): require_once('/usr/share/weba...')
 #22 {main}
````

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
fretn added a commit to fretn/server that referenced this pull request Jan 24, 2019
when $share === false then (int)$share['share_type'] will always be equal to (int)0

which results in following crash:

[root@server nextcloud]# sudo -u apache php occ files:scan someuser
The current PHP memory limit is below the recommended value of 512MB.
Starting scan for user 1 out of 1 (someuser)
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\OCS\DiscoveryService::discover() must be of the type string, null given, called in /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php on line 382 and defined in /var/www/html/nextcloud/lib/private/OCS/DiscoveryService.php:65
Stack trace:
#0 /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php(382): OC\OCS\DiscoveryService->discover(NULL, 'FEDERATED_SHARI...')
nextcloud#1 /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php(527): OCA\Files_Sharing\External\Manager->sendFeedbackToRemote(NULL, NULL, NULL, 'decline')
nextcloud#2 /var/www/html/nextcloud/apps/files_sharing/lib/External/Storage.php(216): OCA\Files_Sharing\External\Manager->removeShare('files/Someth...')
nextcloud#3 [internal function]: OCA\Files_Sharing\External\Storage->checkStorageAvailability()
nextcloud#4 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(505): call_user_func_array(Array, Array)
nextcloud#5 [internal function]: OC\Files\Storage\Wrapper\Wrapper->__call('checkStorageAva...', Array)
nextcloud#6 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(505): call_user_func_array(Array, Array)
nextcloud#7 /var/www/html/nextcloud/apps/files_sharing/lib/External/Scanner.php(89): OC\Files\Storage\Wrapper\Wrapper->__call('checkStorageAva...', Array)
nextcloud#8 /var/www/html/nextcloud/apps/files_sharing/lib/External/Scanner.php(44): OCA\Files_Sharing\External\Scanner->scanAll()
nextcloud#9 /var/www/html/nextcloud/lib/private/Files/Utils/Scanner.php(245): OCA\Files_Sharing\External\Scanner->scan('', true, 3)
nextcloud#10 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(172): OC\Files\Utils\Scanner->scan('/someuser', true, NULL)
nextcloud#11 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(249): OCA\Files\Command\Scan->scanFiles('someuser', '/someuser', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
nextcloud#12 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(251): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#13 /var/www/html/nextcloud/core/Command/Base.php(162): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#14 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#15 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#16 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#17 /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))
nextcloud#18 /var/www/html/nextcloud/console.php(96): OC\Console\Application->run()
nextcloud#19 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
nextcloud#20 {main}[root@server nextcloud]#
fretn added a commit to fretn/server that referenced this pull request Jan 24, 2019
when $share === false then (int)$share['share_type'] will always be equal to (int)0

which results in following crash:

[root@server nextcloud]# sudo -u apache php occ files:scan someuser
The current PHP memory limit is below the recommended value of 512MB.
Starting scan for user 1 out of 1 (someuser)
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\OCS\DiscoveryService::discover() must be of the type string, null given, called in /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php on line 382 and defined in /var/www/html/nextcloud/lib/private/OCS/DiscoveryService.php:65
Stack trace:
#0 /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php(382): OC\OCS\DiscoveryService->discover(NULL, 'FEDERATED_SHARI...')
nextcloud#1 /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php(527): OCA\Files_Sharing\External\Manager->sendFeedbackToRemote(NULL, NULL, NULL, 'decline')
nextcloud#2 /var/www/html/nextcloud/apps/files_sharing/lib/External/Storage.php(216): OCA\Files_Sharing\External\Manager->removeShare('files/Someth...')
nextcloud#3 [internal function]: OCA\Files_Sharing\External\Storage->checkStorageAvailability()
nextcloud#4 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(505): call_user_func_array(Array, Array)
nextcloud#5 [internal function]: OC\Files\Storage\Wrapper\Wrapper->__call('checkStorageAva...', Array)
nextcloud#6 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(505): call_user_func_array(Array, Array)
nextcloud#7 /var/www/html/nextcloud/apps/files_sharing/lib/External/Scanner.php(89): OC\Files\Storage\Wrapper\Wrapper->__call('checkStorageAva...', Array)
nextcloud#8 /var/www/html/nextcloud/apps/files_sharing/lib/External/Scanner.php(44): OCA\Files_Sharing\External\Scanner->scanAll()
nextcloud#9 /var/www/html/nextcloud/lib/private/Files/Utils/Scanner.php(245): OCA\Files_Sharing\External\Scanner->scan('', true, 3)
nextcloud#10 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(172): OC\Files\Utils\Scanner->scan('/someuser', true, NULL)
nextcloud#11 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(249): OCA\Files\Command\Scan->scanFiles('someuser', '/someuser', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
nextcloud#12 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(251): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#13 /var/www/html/nextcloud/core/Command/Base.php(162): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#14 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#15 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#16 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
nextcloud#17 /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))
nextcloud#18 /var/www/html/nextcloud/console.php(96): OC\Console\Application->run()
nextcloud#19 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
nextcloud#20 {main}[root@server nextcloud]#
@Bevito Bevito mentioned this pull request Oct 12, 2022
9 tasks
@nowatbuer nowatbuer mentioned this pull request Jan 18, 2023
9 tasks
alpapan added a commit to alpapan/nextcloud-server that referenced this pull request Feb 7, 2024
fixes this error caused when system has usernames that are purely numeric.

An unhandled exception has been thrown:
Error: Object of class OCA\User_LDAP\User\User could not be converted to string in /var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php:312
Stack trace:
#0 [internal function]: OCA\User_LDAP\User_LDAP->userExistsOnLDAP()
nextcloud#1 /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php(126): call_user_func_array()
nextcloud#2 /var/www/nextcloud/apps/user_ldap/lib/Proxy.php(140): OCA\User_LDAP\User_Proxy->walkBackends()
nextcloud#3 /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php(262): OCA\User_LDAP\Proxy->handleRequest()
nextcloud#4 /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php(239): OCA\User_LDAP\User_Proxy->userExistsOnLDAP()
nextcloud#5 /var/www/nextcloud/lib/private/User/Manager.php(168): OCA\User_LDAP\User_Proxy->userExists()
nextcloud#6 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(399): OC\User\Manager->get()
nextcloud#7 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(226): OCA\Files_FullTextSearch\Service\FilesService->initFileSystems()
nextcloud#8 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(246): OCA\Files_FullTextSearch\Service\FilesService->getChunksFromUser()
nextcloud#9 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(174): OCA\Files_FullTextSearch\Provider\FilesProvider->generateChunks()
nextcloud#10 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(403): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser()
nextcloud#11 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(280): OCA\FullTextSearch\Command\Index->indexProvider()
nextcloud#12 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OCA\FullTextSearch\Command\Index->execute()
nextcloud#13 /var/www/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
nextcloud#14 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
nextcloud#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
nextcloud#16 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
nextcloud#17 /var/www/nextcloud/lib/private/Console/Application.php(206): Symfony\Component\Console\Application->run()
nextcloud#18 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
nextcloud#19 /var/www/nextcloud/occ(11): require_once('...')
nextcloud#20 {main}roopico /var/www/nextcloud/apps/user_ldap/lib/User/OfflineUser.phparch:index


Signed-off-by: Alexie Papanicolaou <alpapan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants