Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 145 characters in body
Source Link
Simon H
  • 2.5k
  • 4
  • 33
  • 38

Good day,

I tried the example code below [1]Example CLI PHP code from Google. The listFiles()listFiles() method throws a 500 Internal Error from Google's servers, as shown in the stack trace below [2]. I:

bash-4.2$ php test.php PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...') #4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79

I deleted the saved credentials and tried again. That did not help [3]. I:

bash-4.2$ php test.php Open the following link in your browser: https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=urn%3A ietf%3Awg%3Aoauth%3A2.0%3Aoob&client_id=...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&access_type=offline&approval_prompt=auto Enter verification code: ... Credentials saved to /home/ben/.credentials/drive-php-quickstart.json PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...')
#4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79

I searched through the github issues and stackoverflow questions tagged google-api-php-client, but did not find any clues. I logged into the developer console and clicked Logs, which resulted in the text "Failed to load." Any

Failed to load.

Any ideas how to get more detailed information about 500 errors from Google?

Thank you,

-Ben

[1] Example CLI PHP code from Google: https://developers.google.com/drive/web/quickstart/php

[2] Stack trace:

bash-4.2$ php test.php PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...') #4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79 

[3] Stack trace for final attempt after deleting saved credentials:

bash-4.2$ php test.php Open the following link in your browser: https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=urn%3A ietf%3Awg%3Aoauth%3A2.0%3Aoob&client_id=...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&access_type=offline&approval_prompt=auto Enter verification code: ... Credentials saved to /home/ben/.credentials/drive-php-quickstart.json PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...') #4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79 

Good day,

I tried the example code below [1]. The listFiles() method throws a 500 Internal Error from Google's servers, as shown in the stack trace below [2]. I deleted the saved credentials and tried again. That did not help [3]. I searched through the github issues and stackoverflow questions tagged google-api-php-client, but did not find any clues. I logged into the developer console and clicked Logs, which resulted in the text "Failed to load." Any ideas how to get more detailed information about 500 errors from Google?

Thank you,

-Ben

[1] Example CLI PHP code from Google: https://developers.google.com/drive/web/quickstart/php

[2] Stack trace:

bash-4.2$ php test.php PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...') #4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79 

[3] Stack trace for final attempt after deleting saved credentials:

bash-4.2$ php test.php Open the following link in your browser: https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=urn%3A ietf%3Awg%3Aoauth%3A2.0%3Aoob&client_id=...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&access_type=offline&approval_prompt=auto Enter verification code: ... Credentials saved to /home/ben/.credentials/drive-php-quickstart.json PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...') #4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79 

I tried the Example CLI PHP code from Google. The listFiles() method throws a 500 Internal Error from Google's servers, as shown in the stack trace:

bash-4.2$ php test.php PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...') #4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79

I deleted the saved credentials and tried again. That did not help:

bash-4.2$ php test.php Open the following link in your browser: https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=urn%3A ietf%3Awg%3Aoauth%3A2.0%3Aoob&client_id=...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&access_type=offline&approval_prompt=auto Enter verification code: ... Credentials saved to /home/ben/.credentials/drive-php-quickstart.json PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...')
#4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79

I searched through the github issues and stackoverflow questions tagged google-api-php-client, but did not find any clues. I logged into the developer console and clicked Logs, which resulted in the text

Failed to load.

Any ideas how to get more detailed information about 500 errors from Google?

Source Link

Google API php quickstart listFiles() 500 Internal Error

Good day,

I tried the example code below [1]. The listFiles() method throws a 500 Internal Error from Google's servers, as shown in the stack trace below [2]. I deleted the saved credentials and tried again. That did not help [3]. I searched through the github issues and stackoverflow questions tagged google-api-php-client, but did not find any clues. I logged into the developer console and clicked Logs, which resulted in the text "Failed to load." Any ideas how to get more detailed information about 500 errors from Google?

Thank you,

-Ben

[1] Example CLI PHP code from Google: https://developers.google.com/drive/web/quickstart/php

[2] Stack trace:

bash-4.2$ php test.php PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...') #4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79 

[3] Stack trace for final attempt after deleting saved credentials:

bash-4.2$ php test.php Open the following link in your browser: https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=urn%3A ietf%3Awg%3Aoauth%3A2.0%3Aoob&client_id=...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&access_type=offline&approval_prompt=auto Enter verification code: ... Credentials saved to /home/ben/.credentials/drive-php-quickstart.json PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?maxResults=10: (500) Internal Error' in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php:79 Stack trace: #0 /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request)) #1 /home/ben/.../vendor/google/apiclient/src/Google/Client.php(556): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #2 /home/ben/.../vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client->execute(Object(Google_Http_Request)) #3 /home/ben/.../vendor/google/apiclient/src/Google/Service/Drive.php(1783): Google_Service_Resource->call('list', Array, 'Google_Service_...') #4 /home/ben/.../test.php(78): Google_Service_Drive_Files_Resource->listFiles(Arra in /home/ben/.../vendor/google/apiclient/src/Google/Http/REST.php on line 79