Fatal error while executing cron job in Google AppEngine - php

I want to execute a cron job in GAE but i got this error.I want to use app engine services without logging in to my email.
PHP Fatal error: Uncaught exception 'Google_AuthException' with message 'Could not json decode the token' in /base/data/home/apps/s~gcdc2013-cloud-daybook/1.371004284914522718/google-api-php-client/src/auth/Google_OAuth2.php:162
Stack trace:
#0 /base/data/home/apps/s~gcdc2013-cloud-daybook/1.371004284914522718/google-api-php-client/src/Google_Client.php(170): Google_OAuth2->setAccessToken(NULL)

Does it work when you're not running it from cron?
It looks like your either missing the service account key, or you're not loading it properly.

Related

Showing fatal PHP errors in GAE appengine logs

In local dev environment I see php errors from a call to an external REST service (payment gateway). This is dumped on my browser as expected and shows up in the log console (GAE launcher) - no problem.
Fatal error: Uncaught exception 'Paybrkr\Error\InvalidRequest' with message 'Invalid integer: 997.001' in E:\code\apper\application\libraries\Paybrkr\lib\ApiRequestor.php:98 Stack trace: #0 ...
In production, users just see a blank/500 error which I understand is by design. However the error appears nowhere in the prod logs. I would expect under Critical or Error log level. Any special settings required in php.ini for GAE?

Getting 500 Internal Server Error with Stripe

I am trying to implement basic functionality of the Stripe API, I get 500 Internal Server Error for some reason when I require the Stripe.php file that you have to require...When I comment the require out the error goes away but obviously I can not use the API then..
Basic require...shows error in the Modal Log
require_once('/php/Stripe.php');
I checked the server error and it gave me this back
Fatal error: Uncaught exception 'Exception' with message 'Stripe needs the Multibyte String PHP extension.' in /php/Stripe.php:13 Stack trace: #0 /home/stripepost.php(4): require_once() #1 {main} thrown in /php/Stripe.php on line 13
This all comes from just requiring the file..
Is your 'Stripe.php' file really located in '/php' or is it in a folder called 'php' local to your code?
Current code:
require_once('/php/Stripe.php');
I think the problem is this. You probably mean to use something relative to your code base. Like this:
require_once('./php/Stripe.php');
I found out the answer I didn't have the mbstring enabled on my server...whooops

Google_ServiceException while using Mirror api php sdk

I'm getting errors while running Google Glass quick starter PHP project using Mirror API. I've seen a similar question in the forum but in my case i've enabled the Mirror api in the Google API console. We are working in a group using a new Gmail account(that aptly describes our group) which has been tied up to our Glass very recently.
In the error log it says:
Uncaught exception 'Google_ServiceException' with message 'Error calling GET
https://www.googleapis.com/mirror/v1/timeline?maxResults=3&key=xxxxxxxxxxx: (403)
Access Not Configured'
Any help in this regard would be very much appreciated.
Thanking the experts in advance.
The complete error log:
PHP Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/mirror/v1/timeline?maxResults=3&key=xxxxxxxxxxxxxx: (403) Access Not Configured' in /var/www/mirror-quickstart-php/google-api-php-client/src/io/Google_REST.php:66\nStack trace:\n#0 /var/www/mirror-quickstart-php/google-api-php-client/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest))\n#1 /var/www/mirror-quickstart-php/google-api-php-client/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest))\n#2 /var/www/mirror-quickstart-php/google-api-php-client/src/contrib/Google_MirrorService.php(434): Google_ServiceResource->__call('list', Array)\n#3 /var/www/mirror-quickstart-php/index.php(142): google_TimelineServiceResource->listTimeline(Array)\n#4 {main}\n thrown in /var/www/mirror-quickstart-php/google-api-php-client/src/io/Google_REST.php on line 66
And in the index.php line 142 shows:
//Load cool stuff to show them.
$timeline = $mirror_service->timeline->listTimeline(array('maxResults'=>'3'));

cakephp error Uncaught exception 'LogicException'

I'm new to cakePHP and I've been having real difficulty getting it working on my free aws account. I first tried setting up LAMP on my own, but gave up and am now trying to use the bitnami LAMP stack:
https://aws.amazon.com/amis/bitnami-lapp-stack-5-4-13-1-64-bit-ubuntu-12-04
Anyways, that seemed to work, and I was following the cakePHP Blogs tutorial:
http://book.cakephp.org/2.0/en/getting-started.html
I got the mySQL database and tables all set up, and just to test I went to the cakePHP dir:
http://[my amazon instance].compute-1.amazonaws.com/cakephp/
Page loads up with no problems.
But if I reload that page, I get an error:
PHP Fatal error: Uncaught exception 'LogicException' with message 'Passed array does not specify an existing static method (class 'App' does not have a method 'load')' in /opt/bitnami/frameworks/cakephp/lib/Cake/bootstrap.php:133\nStack trace:\n#0 /opt/bitnami/frameworks/cakephp/lib/Cake/bootstrap.php(133): spl_autoload_register(Array)\n#1 /opt/bitnami/frameworks/cakephp/app/webroot/index.php(77): include('/opt/bitnami/fr...')\n#2 {main}\n thrown in /opt/bitnami/frameworks/cakephp/lib/Cake/bootstrap.php on line 133
At that point, nothing to do but restart apache. Once again the page shows up one time, then reload and it errors as above.
Halp!

Facebook Needs the JSON php extension?>

I am trying to use FB login. I have used the same code for other websites and it works fine. But only one domain it returns a fatal error.
Fatal error: Uncaught 'Exception' with message 'Facebook needs the
JSON PHP extension' in
/var/www/vhosts/domain.com/httpdocs/base_facebook.php:22 Stack trace
/var/www/vhosts/domain.com/httpdocs/facebook.php:18 require_once()#1 ....
Facebook needs the JSON PHP extension installed on your server.
You will need to talk to the server administrator and ask them to install the extension for you.

Categories