When I use the option "enable_stackdriver_integration: true" on Google App Engine (Flexible PHP) with the Laravel framework to send logs (and error logs) to Google Stackdriver, it works.
But when I'm tryin to run a PHP command line (Eg: php artisan migrate) from the php docker container into an instance of the app engine, I got the following error:
PHP Warning: sem_get(): failed for key 0x41019ecd: Permission denied in /app/vendor/google/cloud-core/src/Batch/SysvConfigStorage.php on line 71
PHP Warning: sem_acquire() expects parameter 1 to be resource, boolean given in /app/vendor/google/cloud-core/src/Batch/SysvConfigStorage.php on line 81
PHP Warning: shm_attach(): failed for key 0x41019ecd: Permission denied in /app/vendor/google/cloud-core/src/Batch/SysvConfigStorage.php on line 130
PHP Warning: shm_attach(): failed for key 0x41019ecd: Permission denied in /app/vendor/google/cloud-core/src/Batch/SysvConfigStorage.php on line 156
PHP Warning: shm_remove_var() expects parameter 1 to be resource, boolean given in /app/vendor/google/cloud-core/src/Batch/SysvConfigStorage.php on line 157
PHP Warning: sem_release() expects parameter 1 to be resource, boolean given in /app/vendor/google/cloud-core/src/Batch/SysvConfigStorage.php on line 91
PHP Fatal error: Uncaught RuntimeException: Failed to attach to the shared memory in /app/vendor/google/cloud-core/src/Batch/SysvConfigStorage.php:132
Stack trace:
#0 /app/vendor/google/cloud-core/src/Batch/BatchRunner.php(191): Google\Cloud\Core\Batch\SysvConfigStorage->load()
#1 /app/vendor/google/cloud-core/src/Batch/BatchRunner.php(74): Google\Cloud\Core\Batch\BatchRunner->loadConfig()
#2 /app/vendor/google/cloud-core/src/Batch/BatchTrait.php(201): Google\Cloud\Core\Batch\BatchRunner->__construct()
#3 /app/vendor/google/cloud-logging/src/PsrLogger.php(150): Google\Cloud\Logging\PsrLogger->setCommonBatchProperties(Array)
#4 /app/vendor/google/cloud-logging/src/LoggingClient.php(575): Google\Cloud\Logging\PsrLogger->__construct(Object(Google\Cloud\Logging\Logger), NULL, Array)
#5 /app/vendor/google/cloud-error-reporting/src/Bootstrap.php(40): Google\Cloud\Logging\LoggingClient->psrLogger('app-error', Array)
#6 /app/vendor/google/cloud-error-reporting/src/prepend.php(68): Google\Cloud\ErrorReporting\Bootstrap::init(NULL)
#7 in /app/vendor/google/cloud-core/src/Batch/SysvConfigStorage.php on line 132
Off course, if I remove the option from the app.yaml there is no problem. Do you know why ?
Related
I'm getting this error. Can you please help me understand why it is coming and what does it mean. I did not change any code. It is running on PHP 7.1 and Operating system is Linux.
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20170718
These options need to match in Unknown on line 0
PHP Fatal error: Uncaught Error: Call to undefined function
simplexml_load_string() in public_html/lib/Varien/Simplexml/Config.php:510
Stack trace:
#0 /home3/ramesqj3/public_html/lib/Varien/Simplexml/Config.php(498):
Varien_Simplexml_Config->loadString('<?xml version="...',
'Mage_Core_Model...')
#1/home3/ramesqj3/public_html/app/code/core/Mage/Core/Model/Config.php(277):
Varien_Simplexml_Config->loadFile('/home3/ramesqj3...')
#2 /home3/ramesqj3/public_html/app/code/core/Mage/Core/Model/App.php(391):
Mage_Core_Model_Config->loadBase()
#3 /home3/ramesqj3/public_html/app/code/core/Mage/Core/Model/App.php(304):
Mage_Core_Model_App->_initBaseConfig()
#4 /home3/ramesqj3/public_html/app/code/core/Mage/Core/Model/App.php(348):
Mage_Core_Model_App->baseInit(Array)
#5 /home3/ramesqj3/public_html/app/Mage.php(686): Mage_Core_Model_App-
>run(Array)
#6 /home3/ramesqj3/public_html/index.php(83): Mage::run('', 'store')
#7 {main}
thrown in public_html/lib/Varien/Simplexml/Config.php on line 510
I know whenever someone types wrong artisan command a well-formatted error message is shown
But there is some problem in my project because when I run wrong command eg
php artisan create:migration create_table
I am getting this output
PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "/home/amarjit/Documents/localhost/inkpothub/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107
Stack trace:
#0 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\StreamHandler->write(Array)
#1 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Logger.php(337): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#2 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Logger.php(616): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array)
#3 /home/amarjit/Documents/localhost/inkpothub/vendor/laravel/framework/src/Illuminate/Log/Writer.php(202): Monolog\Logger->error(Object(UnexpectedValueException), Array)
#4 /home/amarjit/Documents/localhost/inkpothu in /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "/home/amarjit/Documents/localhost/inkpothub/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107
Stack trace:
#0 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\StreamHandler->write(Array)
#1 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Logger.php(337): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#2 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Logger.php(616): Monolog\Logger->addRecord(400, Object(Symfony\Component\Debug\Exception\FatalErrorException), Array)
#3 /home/amarjit/Documents/localhost/inkpothub/vendor/laravel/framework/src/Illuminate/Log/Writer.php(202): Monolog\Logger->error(Object(Symfony\Component\Debug\Exception\FatalErrorExcept in /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
its only happening with one of my Laravel-5.3 project. Therefore the issue is not related with my localhost
So, running cap production deploy now fails and gives me this log:
DEBUG [d8e9f9b4] Generating autoload files
DEBUG [d8e9f9b4] > Illuminate\Foundation\ComposerScripts::postInstall
DEBUG [d8e9f9b4] PHP Warning: Uncaught ErrorException: require(/some_path/releases/20161101100659/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php): failed to open stream: No such file or directory in /some_path/releases/20161101100659/vendor/composer/autoload_real.php:55
Stack trace:
#0 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(55): Composer\Util\ErrorHandler::handle(2, 'require(/srv/us...', '/path/...', 55, Array)
#1 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(55): require()
#2 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(45): composerRequire28a339249b76e8c9bd2081b3b12636da('decc78cc4436b12...', '/path/...')
#3 /some_path/releases/20161101100659/vendor/autoload.php(7): ComposerAutoloaderInit28a339249b76e8c9bd2081b3b12636da::getLoader()
#4 /some_path/releases/201611011006 in /some_path/releases/20161101100659/vendor/composer/autoload_real.php on line 55
DEBUG [d8e9f9b4]
Warning: Uncaught ErrorException: require(/some_path/releases/20161101100659/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php): failed to open stream: No such file or directory in /some_path/releases/20161101100659/vendor/composer/autoload_real.php:55
Stack trace:
#0 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(55): Composer\Util\ErrorHandler::handle(2, 'require(/path/...', '/path/...', 55, Array)
#1 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(55): require()
#2 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(45): composerRequire28a339249b76e8c9bd2081b3b12636da('decc78cc4436b12...', '/path/...')
#3 /some_path/releases/20161101100659/vendor/autoload.php(7): ComposerAutoloaderInit28a339249b76e8c9bd2081b3b12636da::getLoader()
#4 /some_path/releases/201611011006 in /some_path/releases/20161101100659/vendor/composer/autoload_real.php on line 55
DEBUG [d8e9f9b4] PHP Fatal error: composerRequire28a339249b76e8c9bd2081b3b12636da(): Failed opening required '/some_path/releases/20161101100659/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php' (include_path='.:/opt/sp/php7.0/lib/php') in /some_path/releases/20161101100659/vendor/composer/autoload_real.php on line 55
DEBUG [d8e9f9b4]
Fatal error: composerRequire28a339249b76e8c9bd2081b3b12636da(): Failed opening required '/some_path/releases/20161101100659/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php' (include_path='.:/opt/sp/php7.0/lib/php') in /some_path/releases/20161101100659/vendor/composer/autoload_real.php on line 55
It worked fine before I changed JWT lib from 0.5.9 to 1.0.0.alpha and added laravelconnect/remote package.
Note: this all works on my local machine. I've no idea why phpsec doesn't have bootstrap.php file in it. On my local machine it does have it.
I got this error when trying to run my php artisan migrate on my production server...
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
I ran env on the command line and I have an env variable called BUGSNAG_API_KEY and the value of it exactly matches the key at bugsnag.com for this project.
Furthermore, I have this line in my project at ./config/bugsnag.php
'api_key' => env('BUGSNAG_API_KEY'),
Weirdly, I eventually tried the same command again (php artisan migrate) and it worked! But it's left me very unsettled as it's a production server. So I'd like to understand the problem.
Errors seem to be logging in Bugsnag as well by the way.
Try to regenerate the configuration cache with php artisan config:cache. It will use the current data from the .env file to generate a new configuration cache. This worked for me.
In case this helps anyone...
The Bugsnag Git Repo mentions this issue:
(Uncaught exception 'ReflectionException' with message 'Class bugsnag.logger does not exist'
Github user GrahamCampbell suggested that what is actually happening is that another error exists, but it's "...trying to log to bugsnag which is causing this error, which is hiding the real error". I confirmed this was my issue by doing what user russianryebread suggested, which was to manually copy the bugsnag.php config file over to the Laravel /config directory. Once I did that now my real error shows:
[Symfony\Component\Debug\Exception\FatalThrowableError] Parse error: syntax error, unexpected '{'
Now to troubleshoot this issue :)
Hope this helps!
I'm trying to set up a cronjob for magento.
My cronjob is:
*/5 * * * * /bin/sh /var/www/vhosts/#######/httpdocs/cron.sh >/dev/null 2>&1
This works well, but cron.sh is giving this error:
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.3.2-1ubuntu4.9. Rebuild it for your PHP version (5.3.2-1ubuntu4.14) or download precompiled binaries.
PHP Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
PHP Warning: realpath(): SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /var/www/vhosts/########/httpdocs/app owned by uid 10001 in /var/www/vhosts/########/httpdocs/app/Mage.php on line 273
PHP Fatal error: Uncaught exception 'Mage_Core_Exception' with message ' is not a directory or not readable by this user' in /var/www/vhosts/########/httpdocs/app/Mage.php:594
Stack trace:
#0 /var/www/vhosts/########/httpdocs/app/Mage.php(278): Mage::throwException(' is not a direc...')
#1 /var/www/vhosts/########/httpdocs/app/Mage.php(752): Mage::setRoot()
#2 /var/www/vhosts/########/httpdocs/cron.php(29): Mage::isInstalled()
#3 {main}
thrown in /var/www/vhosts/########/httpdocs/app/Mage.php on line 594
Deleted the first line of /etc/php5/cli/conf.d/mcript.ini (Number 12)
This may help you
For reference :
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/573436
eaccelerator : https://wiki.archlinux.org/index.php/EAccelerator
safe_mode : just comment safe_mode or Laravel shared hosting - Directive 'safe_mode' is deprecated in PHP 5.3 and greater
app :file permission issue give -R 777