Unknown Error in Facebook Apps. when get user info - php

The problem is.. that when I try to login the user and then get the user info, I get error from Facebook API. with error code: 1
The same code works for one server, but not another one. THe config and everything are the same, except the non-working one is hosted at RackSpace cloud environment. I don't know if that's the cuase.
Information is here:
Server: Nginx. PHP 5
Backend: running Zend framework
API: use FB's facebook.php and facebookapi_php5_restlib.php
fail at the call_method, post_request(), when calling " facebook.users.getInfo "
Here is the error message
Exception
Error Code: 1
Message: An unknown error occurred
#0 /home/www/entouraxyz-dev.sector3gamez.com/site_prod/_library/facebook/facebookapi_php5_restlib.php(956): FacebookRestClient->call_method('facebook.fql.qu...', Array)
#1 /home/www/entouraxyz-dev.sector3gamez.com/site_prod/app/facebook/controllers/FacebookController.php(375): FacebookRestClient->fql_query('SELECT uid, fir...')
#2 /home/www/entouraxyz-dev.sector3gamez.com/site_prod/app/facebook/controllers/FacebookController.php(114): Facebook_FacebookController->_facebook_login()
#3 /home/www/entouraxyz-dev.sector3gamez.com/site_prod/_library/Zend/Controller/Action.php(132): Facebook_FacebookController->init()
#4 /home/www/entouraxyz-dev.sector3gamez.com/site_prod/_library/Zend/Controller/Dispatcher/Standard.php(261): Zend_Controller_Action->__construct(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http), Array)
#5 /home/www/entouraxyz-dev.sector3gamez.com/site_prod/_library/Zend/Controller/Front.php(945): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#6 /home/www/entourxyz-dev.sector3gamez.com/site_prod/_library/Zcms/Application.php(226): Zend_Controller_Front->dispatch()
#7 /home/www/entourxyz-dev.sector3gamez.com/site_prod/index.php(38): Zcms_Application::run('MainPlugin')
#8 {main}
I have tested the PHPInfo. exactly the same. Max Execute timeout is 60sec. and CURL timeout is increased to 60 too. so. it may not be the timeout issue.

I have found that the Facebook API will shut you out for a day or so (not tested how long exactly) when you've been testing your app and been sending a lot of invalid (?) requests.
Wait a while and it will likely work again. The reason it happens on one server only will likely be the IP address.
All of this is speculated since Facebook won't specify anything regarding limitation or blocking, for security reasons.

Related

Google API Curl timed out

Since yesterday I have been seeing a lot of these errors in my logs:
Operation timed out after 100001 milliseconds with 0 bytes received
File: /var/www/html/vendor/google/apiclient/src/Google/IO/Curl.php(126)
Trace: #0 /var/www/html/vendor/google/apiclient/src/Google/IO/Abstract.php(136): Google_IO_Curl->executeRequest(Object(Google_Http_Request))
#1 /var/www/html/vendor/google/apiclient/src/Google/Http/REST.php(60): Google_IO_Abstract->makeRequest(Object(Google_Http_Request))
#2 /var/www/html/vendor/google/apiclient/src/Google/Task/Runner.php(174): Google_Http_REST::doExecute(Object(Google_Client), Object(Google_Http_Request))
#3 /var/www/html/vendor/google/apiclient/src/Google/Http/REST.php(46): Google_Task_Runner->run()
#4 /var/www/html/vendor/google/apiclient/src/Google/Client.php(593): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request))
#5 /var/www/html/vendor/google/apiclient/src/Google/Service/Resource.php(240): Google_Client->execute(Object(Google_Http_Request))
#6 /var/www/html/vendor/google/apiclient/src/Google/Service/Drive.php(2000): Google_Service_Resource->call('update', Array, 'Google_Service_...')
#7 /var/www/html/app/lib/GoogleDriveHelper.php(185): Google_Service_Drive_Files_Resource->update('1jbLDzGVNNNigA...', Object(Google_Service_Drive_DriveFile), Array)
#8 /var/www/html/app/lib/GoogleDriveHelper.php(131): GoogleDriveHelper->updateFile('1jbLDzGVNNNigA...', '/tmp/tr-filesUI...')
#9 /var/www/html/app/lib/GoogleDriveHelper.php(66): GoogleDriveHelper->createOrUpdateFileOnce('Folder/Photo_...', 'Filen...', '/tmp/tr-filesUI...', 'image/jpeg', '', true)
#10 /var/www/html/app/jobs/worker/taskresult-photo-upload-to-gdrive.php(170): GoogleDriveHelper->createOrUpdateFile('Folder/Photo_...', 'Filen...', '/tmp/tr-filesUI...', 'image/jpeg')
#11 [internal function]: upload_photos_to_gdrive(Object(GearmanJob), NULL)
#12 /var/www/html/app/jobs/uploads-worker.php(5): GearmanWorker->work()
I have tried checking Google Services status page and there are no reported issues.
I haven't seen this exception occur before and nothing on my side has changed.
I should note that this only happens quite rarely and sometimes Google Drive responds with 502 error status code and the following message:
<p>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds. <ins>That’s all we know.</ins>
Maybe you have been tackling this issue and could point me to explanation of what is happening, is this preventable (if so - how) or are these issues on my side of services?
There is nothing you can do about 500 errors they are an error on googles side. As recommended in the documentation you should implement exponential backoff.
If you get a 500 error wait a few seconds and try again. If it still doesn't work wait double the amount of time if it still doesn't work wait three times the amount of time.
If after say 15 attempts it still doesn't work then something is probably down. exponential-backoff
The HyperText Transfer Protocol (HTTP) 502 Bad Gateway server error response code indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server.

Wordpress wp-admin fatal error

I have just switched my website's hosting and it is giving me error in opening the wordpress admin panel page. Can any body help me out. Thankyou
Fatal error: Uncaught Error: Call to undefined function eregi() in
/home/atifchat/public_html/pakistanivoicechat.com/wp-content/plugins/google-bot-bling/google-bot-bling.php:59
Stack trace: #0
/home/atifchat/public_html/pakistanivoicechat.com/wp-includes/class-wp-hook.php(298):
thisismyurl_google_bot_bling_init_code('') #1
/home/atifchat/public_html/pakistanivoicechat.com/wp-includes/class-wp-hook.php(323):
WP_Hook->apply_filters(NULL, Array) #2
/home/atifchat/public_html/pakistanivoicechat.com/wp-includes/plugin.php(453):
WP_Hook->do_action(Array) #3
/home/atifchat/public_html/pakistanivoicechat.com/wp-settings.php(448):
do_action('init') #4
/home/atifchat/public_html/pakistanivoicechat.com/wp-config.php(104):
require_once('/home/atifchat/...') #5
/home/atifchat/public_html/pakistanivoicechat.com/wp-load.php(37):
require_once('/home/atifchat/...') #6
/home/atifchat/public_html/pakistanivoicechat.com/wp-admin/admin.php(31):
require_once('/home/atifchat/...') #7
/home/atifchat/public_html/pakistanivoicechat.com/wp-admin/in in
/home/atifchat/public_html/pakistanivoicechat.com/wp-content/plugins/google-bot-bling/google-bot-bling.php
on line 59
What hosting did you switch from as well as what hosting did you switch it to? A lot of hosts for WordPress will give you support for this kind of thing especially if you just switched to their services so I would probably call support and give them the URL so that they can see the error and it is likely that they will give you some help. If they don't, try this article: http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/
I remember migrating a site and having to FTP in to rename the plugins folder to plugins.hold or something and then I could login then I went back and renamed it again. But just to be safe I would follow the article and not my words.
The eregi() function, actually, the entire ereg_* family of functions was removed entirely in PHP 7.x. According to your error log, you have a voice chat plugin still using those functions.
Stack trace: #0 /home/atifchat/public_html/pakistanivoicechat.com/wp-includes/class-wp-hook.php
Suggestion: Contact plugin developer and ask them to update.

Phalcon PHP - Controller handler class cannot be loaded

I have an application written in Phalcon 2. This application runs locally normally, everything works. My problem is to make it run on an Amazon Ec2 Linux server. Some controllers work normally, the routes are OK.
My problem is with some controller inside the admin area. Not all controllers give me errors, some work. This is the error I get:
AdminproductController handler class cannot be loaded
#0 [internal function]: Phalcon\Mvc\Dispatcher->_throwDispatchException('AdminproductCon...', 2)
#1 [internal function]: Phalcon\Dispatcher->_dispatch()
#2 [internal function]: Phalcon\Dispatcher->dispatch()
#3 /var/www/html/public/index.php(31): Phalcon\Mvc\Application->handle()
#4 {main}
I've been reading about this error on Phalcon's forum and so far none of the answers solve my issue yet. What I'm trying to do is check if it is a case sensitive problem. But no matter what I do, the controller never loads and the error messages are always the same.
Would you have some tips, like steps or a checklist, for me to follow to try to fix this issue?
Maybe AdminproductController must be called AdminProductController or a class file was renamed and you have to change the usage of the class. Also read #Timothy's comments.

How do I stop the "Class log cannot be found" error from occurring in laravel?

I just moved my website to a separate server in an attempt to make sure that when I push the site to the production server everything transitions smoothly. Unfortunately, the site appears blank when I visit the link unless I add something like "echo 'hello';" to the index.php page, nothing is being logged in the laravel storage files (even though the permissions are recursively set to 777), and I get this error:
nickstaging#ubuntuStaging:/var/www/html/almost_acceptable$ php artisan config:cache
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var
/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
I cannot, for the life of me, figure out why it's occurring. It is recorded in the apache log file on the server. The site still runs correctly on my local homestead vm that I have running for general testing, and I tried reuploading all of the files to the server but nothing has worked.
If anyone has any idea why this is occurring, that would be great and I would very much appreciate it! Thanks in advance!
Edit
Installing php-mysql did not fix the problem and there was no difference in the error afterwards.
The most common problem is either you have spaces in your .env file or a wrong value in one of your config files.
More info here:
https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist

Uncaught exception 'MongoCursorException' with message 'localhost:27017: DBClientBase::findN: transport error

i have used this website for years but this is my first time asking a question, so feel free to correct me if i don't do it right.
We are running into this problem a lot lately.
We have mongos running one multiple Centos5 servers connecting to sharded replicaset mongodb servers running 2.4.9.
Recently we did a lot of optimization which increased our throughput and while this problem used to happen a lot before, it's now become intolerable.
After certain number of successful read requests the php just errors out and throws same error over and over. After awhile it can recover. This seems to be on per-app server basis and does not affect all app servers at the same time.
If I pkill mongo and start a new mongos connection, this is usually fixed.
any idea on which direction to dig in or maybe pointers are appreciated, thanks.
this is the error we get:
Fatal error: Uncaught exception 'MongoCursorException' with message 'localhost:27017: DBClientBase::findN: transport error: internal-mongo-r1-d2-dev.myserver.com:27017 ns: admin.$cmd query: { setShardVersion: "", init: true, configdb: "internal-mongo-c1-dev.myserver.com:27019,internal-mongo-c2-dev.myserver.com:27019,internal-mongo-c3-dev.myserver.com:27019", serverID: ObjectId('52f57ce26ca6543144b077e5'), authoritative: true }' in /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/db/mongo/mongo.inc:185
Stack trace:
#0 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/db/mongo/mongo.inc(185): MongoCursor->rewind()
#1 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/db/data.inc(62): MongoCG::get(Array)
#2 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/data/session/savedsession.inc(30): Data::select('mongo', 'coll_saved_sess...', '_id', 'updated_ss', Array, Array)
#3 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/data/session/savedsession.inc(20): SavedSession::select(Array)
#4 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/access/phpsession.inc(32): SavedSession::get_one('fl0uq0nqjbbo4iq...')
#5 [internal function]: PhpSession::read('fl0uq0nqjbbo4iq...')
#6 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/access/phpsession.inc(16): session_start()
#7 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/allinc.inc(15): PhpSession::start()
#8 /mnt/home/webapps/cgs-sys/releases/20140207163554/p.php(4): include_once('/mnt/home/webap...')
#9 {main}
thrown in /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/db/mongo/mongo.inc on line 185
just wanted to do a quick follow up.
after digging in we found out that we had a low setting of "open files" on the mongod servers which was fixed, and these errors disappeared.
There are quite a few references around to similar errors and the general suggestion is the first thing to look at at TCP keepalive.
Apart from the other considerations you may also want to look at keepalive settings in your driver connection.
Some links as a place to start:
https://www.google.com.au/search?q=mongodb+transport+error
https://groups.google.com/forum/#!topic/mongodb-user/eod_QH9-VIY
https://jira.mongodb.org/browse/SERVER-3446
https://www.google.com.au/search?q=mongodb+transport+error

Categories