owncloud / owncloud/core

Catchable error messages in Google Drive bow up the owncloud log

Open
#38,359 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type:Bug
Dominant language
PHP
Stars
8.8k
Forks
2.1k
Avg merge
20h 7m
Merged PRs (30d)
41

Description

Steps to reproduce
  1. Using Google Drive for one mount
Expected behaviour

When GD reports an error, the error should be captured and properly displayed in the log.
See first line in ownCloud log below.

Actual behaviour

The log entry contains debug info because it is not catched.

Note 1

The bad thing is, that uncatched GD errors are responded on every backend sync and fill up the log a lot.
Readability is very low.

Note 2

Found an issue regarding the error itself (userRateLimitExceeded) https://github.com/owncloud/core/issues/20481

Server configuration

Operating system: Ubuntu 20.04

Web server: nginx

Database: mariadb

PHP version: 7.4

ownCloud version: 10.6

Updated from an older ownCloud or fresh install: updated

Where did you install ownCloud from: tar

Signing status (ownCloud 9.0 and above):

all ok

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

Are you using encryption: no

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

Logs
Web server error log
no relevant entry
ownCloud log (data/owncloud.log)
Exception: {\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"usageLimits\",\n    \"reason\": \"userRateLimitExceeded\",\n    \"message\": \"User Rate Limit Exceeded. Rate of requests for user exceed configured project quota. You may consider re-evaluating expected per-user traffic to the API and adjust project quota limits accordingly. You may monitor aggregate quota usage and adjust limits in the API Console: https:\/\/console.developers.google.com\/apis\/api\/drive.googleapis.com\/quotas?project=xyz\",\n    \"extendedHelp\": \"https:\/\/console.developers.google.com\/apis\/api\/drive.googleapis.com\/quotas?project=xyz\"\n   }\n  ],\n  \"code\": 403,\n  \"message\": \"User Rate Limit Exceeded. Rate of requests for user exceed configured project quota. You may consider re-evaluating expected per-user traffic to the API and adjust project quota limits accordingly. You may monitor aggregate quota usage and adjust limits in the API Console: https:\/\/console.developers.google.com\/apis\/api\/drive.googleapis.com\/quotas?project=xyz\"\n }\n}\n: {\"Exception\":\"Google\\\\Service\\\\Exception\",\"Message\":\"{\\n \\\"error\\\": {\\n  \\\"errors\\\": [\\n   {\\n    \\\"domain\\\": \\\"usageLimits\\\",\\n    \\\"reason\\\": \\\"userRateLimitExceeded\\\",\\n    \\\"message\\\": \\\"User Rate Limit Exceeded. Rate of requests for user exceed configured project quota. You may consider re-evaluating expected per-user traffic to the API and adjust project quota limits accordingly. You may monitor aggregate quota usage and adjust limits in the API Console: https:\\\/\\\/console.developers.google.com\\\/apis\\\/api\\\/drive.googleapis.com\\\/quotas?project=xyz\\\",\\n    \\\"extendedHelp\\\": \\\"https:\\\/\\\/console.developers.google.com\\\/apis\\\/api\\\/drive.googleapis.com\\\/quotas?project=xyz\\\"\\n   }\\n  ],\\n  \\\"code\\\": 403,\\n  \\\"message\\\": \\\"User Rate Limit Exceeded. Rate of requests for user exceed configured project quota. You may consider re-evaluating expected per-user traffic to the API and adjust project quota limits accordingly. You may monitor aggregate quota usage and adjust limits in the API Console: https:\\\/\\\/console.developers.google.com\\\/apis\\\/api\\\/drive.googleapis.com\\\/quotas?project=xyz\\\"\\n }\\n}\\n\",\"Code\":403,\"Trace\":\"
#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/google\\\/apiclient\\\/src\\\/Http\\\/REST.php(103): Google\\\\Http\\\\REST::decodeHttpResponse()\\n#1 [internal function]: Google\\\\Http\\\\REST::doExecute()\\
n#2 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/google\\\/apiclient\\\/src\\\/Task\\\/Runner.php(181): call_user_func_array()\\
n#3 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/google\\\/apiclient\\\/src\\\/Http\\\/REST.php(66): Google\\\\Task\\\\Runner->run()\\
n#4 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/google\\\/apiclient\\\/src\\\/Client.php(898): Google\\\\Http\\\\REST::execute()\\
n#5 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/google\\\/apiclient\\\/src\\\/Service\\\/Resource.php(238): Google\\\\Client->execute()\\
n#6 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/google\\\/apiclient-services\\\/src\\\/Google\\\/Service\\\/Drive\\\/Resource\\\/Files.php(245): Google\\\\Service\\\\Resource->call()\\
n#7 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/Lib\\\/Storage\\\/Google.php(164): Google_Service_Drive_Resource_Files->listFiles()\\
n#8 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/Lib\\\/Storage\\\/Google.php(387): OCA\\\\Files_External\\\\Lib\\\\Storage\\\\Google->getDriveFile()\\
n#9 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Common.php(109): OCA\\\\Files_External\\\\Lib\\\\Storage\\\\Google->filetype()\\
n#10 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/Lib\\\/Storage\\\/Google.php(693): OC\\\\Files\\\\Storage\\\\Common->is_file()\\
n#11 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(385): OCA\\\\Files_External\\\\Lib\\\\Storage\\\\Google->hasUpdated()\\
n#12 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Availability.php(394): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->hasUpdated()\\
n#13 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(385): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->hasUpdated()\\
n#14 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(385): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->hasUpdated()\\
n#15 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(385): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->hasUpdated()\\
n#16 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Watcher.php(130): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->hasUpdated()\\
n#17 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/View.php(1409): OC\\\\Files\\\\Cache\\\\Watcher->needsUpdate()\\
n#18 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Files\\\/View.php(1447): OC\\\\Files\\\\View->getCacheEntry()\\
n#19 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php(179): OC\\\\Files\\\\View->getFileInfo()\\
n#20 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Tree.php(70): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath()\\
n#21 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(971): OCA\\\\DAV\\\\Tree->getNodeForPath()\\
n#22 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1661): Sabre\\\\DAV\\\\Server->getPropertiesIteratorForPath()\\
n#23 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1646): Sabre\\\\DAV\\\\Server->writeMultiStatus()\\
n#24 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(346): Sabre\\\\DAV\\\\Server->generateMultiStatus()\\
n#25 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpPropFind()\\
n#26 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(472): Sabre\\\\DAV\\\\Server->emit()\\
n#27 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\
n#28 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(330): Sabre\\\\DAV\\\\Server->start()\\
n#29 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\
n#30 \\\/var\\\/www\\\/owncloud\\\/remote.php(165): require_once('\\\/var\\\/w...')\\
n#31 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/google\\\/apiclient\\\/src\\\/Http\\\/REST.php\",\"Line\":128}

@micbar @jvillafanez

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/files_external/lib/Lib/Storage/Google.php, especially the getDriveFile and filetype paths named in the trace, and reproduce the Google Drive rate-limit failure. Compare the resulting ownCloud log with the reported output; done means the Google Drive error is captured and properly represented without repeatedly flooding the log during backend sync.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.