shpasser / gaesupportl5 Goto Github PK
View Code? Open in Web Editor NEWGoogle App Engine Support package for Laravel 5
License: MIT License
Google App Engine Support package for Laravel 5
License: MIT License
First off, awesome package. Installing this, changing a couple settings, and seeing Laravel running on GAE is amazing.
However, by default the Logger is trying to write to our bucket and we are seeing the following error in the GAE logs:
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "gs://cl-members/storage/logs/laravel-2015-02-20.log" could not be opened: failed to open stream: "\google\appengine\ext\cloud_storage_streams\CloudStorageStreamWrapper::stream_open" call failed' in /base/data/home/apps/s~cl-members/1.382361638587654395/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:84
Stack trace:
#0 /base/data/home/apps/s~cl-members/1.382361638587654395/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(88): Monolog\Handler\StreamHandler->write(Array)
#1 /base/data/home/apps/s~cl-members/1.382361638587654395/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\RotatingFileHandler->write(Array)
#2 /base/data/home/apps/s~cl-members/1.382361638587654395/vendor/monolog/monolog/src/Monolog/Logger.php(265): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#3 /base/data/home/apps/s~cl-members/1.382361638587654395/vendor/monolog/monolog/src/Mo in /base/data/home/apps/s~cl-members/1.382361638587654395/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 84
What is odd is Laravel is successfully creating the gs://cl-members/storage/framework
stuff... Any ideas on how to proceed? I tried manually creating the gs://cl-members/storage/logs
directory, but the same error persists.
I have an application which is deployed to GAE and that is storing files to my bucket using this plugin.
All of this works just fine.
The problem is: I have one virtual machine with the same laravel application on it, but just for processing beanstalkd queues. I have described it more on my other issue #30 .
When trying to access the file using the filesystem abstraction, it is getting the wrong file path.
For example, on my GAE instance, the following code
$disk = Storage::disk('pano_images');
Log::info("Disk path: ".$disk->getDriver()->getAdapter()->getPathPrefix());
returns
Disk path: gs://panopla-staging-4f8x/storage/app/pano_images/
which is correct.
When running the same command on my virtual machine, I get the local path
Disk path: /lamp/pano-cms/storage/app/pano_images/
.
It is probably because of the following mthod on filesystem.php
config file.
'disks' => [
'pano_images' => [
'driver' => 'gae',
'root' => storage_path() . '/app/pano_images'
],
],
I've tried to manually replace the call for storage_path() method with the direct bucket url.
'disks' => [
'pano_images' => [
'driver' => 'gae',
'root' => 'gs://<bucket_id>/storage' . '/app/pano_images'
],
],
But now I get the following error:
[ErrorException]
is_dir(): Unable to find the wrapper "gs" - did you forget to enable it when you configured PHP?
What can I do for accessing this file on my cloud bucket from the VM instance? I was expecting that by using the 'gae' driver, the plugin would take care of all the necessary abstraction.
Note: I'm using the VM to process the beanstalkd queue because I need to run a third-party linux script on PHP and that is just not allowed on GAE.
Hello,
I'm having trouble using cachefs on GAE, I seem to be getting steam_open call failed:
include(cachefs://framework/views/cb7b9947edeeebf2bad55530d2bc4bae): failed to open stream: "Shpasser\GaeSupportL5\Storage\CacheFs::stream_open" call failed (View: /base/data/home/apps/**********/resources/views/errors/404.blade.php)
We are using Laravel 5.1 and we've got in the .env file:
CACHE_SERVICES_FILE=true
CACHE_CONFIG_FILE=true
CACHE_ROUTES_FILE=true
CACHE_COMPILED_VIEWS=true
Has anyone else seen this problem?
Regards,
iamacarpet
When trying to write a log I get the error message:
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "gs://splink/storage/logs/laravel.log" could not be opened: failed to open stream: "\google\appengine\ext\cloud_storage_streams\CloudStorageStreamWrapper::stream_open" call failed' in [path]/bootstrap/cache/compiled.php:13906
I assume there is something wrong with my configuration, any idea what I could be doing wrong?
.env
...
LOG_HANDLER=syslog
config.app.
...
'log' => env('LOG_HANDLER', 'daily'),
Pre-deploy commands
php artisan gae:setup cache-config
php artisan route:cache
php artisan optimize
Let me know if there is any other information that I can provide that would be helpful.
Edit
Note that I'm on Laravel 5.2 which I just realised isn't supported at the moment so that could be the issue.
I seem to be getting this ErrorException, I believe its actually an error writing the error message, but I've used syslog as the command generated. Does anyone know what causes it?
ErrorException in AbstractDumper.php line 66:
fopen(php://stdout): failed to open stream: Unknown stream type php://stdout.
in AbstractDumper.php line 66
at HandleExceptions->handleError('2', 'fopen(php://stdout): failed to open stream: Unknown stream type php://stdout.', '/base/data/home/apps/s~app/1.382426911159954689/vendor/symfony/var-dumper/Symfony/Component/VarDumper/Dumper/AbstractDumper.php', '66', array('output' => 'php://stdout', 'prev' => null, 'this' => object(CliDumper)))
at fopen('php://stdout', 'wb') in AbstractDumper.php line 66
at AbstractDumper->setOutput('php://stdout') in AbstractDumper.php line 44
at AbstractDumper->__construct(null, null) in CliDumper.php line 52
at CliDumper->__construct() in DataFormatter.php line 21
at DataFormatter->__construct() in DataCollector.php line 43
at DataCollector::getDefaultDataFormatter() in DataCollector.php line 62
at DataCollector->getDataFormatter() in TimeDataCollector.php line 125
at TimeDataCollector->addMeasure('Booting', '1424686389.9316', '1424686392.182') in LaravelDebugBar.php line 124
at LaravelDebugbar->Barryvdh\Debugbar\{closure}(object(Application))
at call_user_func(object(Closure), object(Application)) in Application.php line 758
at Application->fireAppCallbacks(array(object(Closure))) in Application.php line 659
at Application->boot() in BootProviders.php line 15
at BootProviders->bootstrap(object(Application)) in Application.php line 167
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 145
at Kernel->bootstrap() in Kernel.php line 106
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
at Kernel->handle(object(Request)) in index.php line 53
Hi @shpasser, when using Mailgun as email provider, I'm getting the following error. It seems the problem is with Guzzle's HTTPS.
production.ERROR: exception 'GuzzleHttp\Exception\ClientException' with message 'Client error:
POST https://api.mailgun.net/v3/rsvp.lk/messages.mime
resulted in a401 Unauthorized
response: Forbidden
I tried using cURL Lite also, that also gives errors. It is really good if we can use cURL Lite. Can we do something for this? I can't use GAE's email service as it has 100 mails per day limit.
It's expecting an instance of Illuminate\Encryption\Encrypter
and getting Illuminate\Contracts\Encryption\Encrypter
instead.
I don't know why Laravel is not creating the laravel_session cookie, I'm experimenting this problem on the development server and on GAE.
The only clue I have is this error I'm getting on the development server:
Unable to delete function dlUnable to delete function mb_send_mailERROR:root:php failure (255) with:
stdout:
X-Powered-By: PHP/5.5.23
Content-type: text/html
Any ideas? (Great work on your package by the way)
Using a fresh Laravel 5 installation, it seems that the GAE:setup command will fail due to a change with how application keys are generated. The error is now as follows:
$ php artisan gae:setup testme-961 --config --cache-config
[ErrorException]
syntax error, unexpected '=' in /cygdrive/c/nginx-1.9.9/html/testme/app/../.env on line 3
Application keys are now encoded with base64 with seems to have an '=' symbol at the end of the string.
For example:
When I generate a new key via artisan (php artisan key:generate
), something along the lines of the following gets placed on the third line of the default .env file:
APP_KEY=base64:QQLFuWBMqP2EqMpmVKhlZWdEC+2QzW534//lsCWQ57s=
I haven't had time to take a through look at the code yet, but I think it might have to due with the InitHelper class. This implementation may not support reading in strings with multiple '=' symbols within the line.
Notes on my current setup:
I've been tidying up my project, and I'm wondering if there's any reason to maintain a separate database config set for Cloud SQL.
My reasoning in this case would be because we're able to influence the runtime via .env
. At which point my instinct is to trim out the cloudsql
entries, and just recycle the mysql
config for both local and live environments.
Might be nice to have one less thing to have to pivot when deploying, and heck -- it's less documentation at that point too! ;)
Hi,
I have a problem with getting files by Storage class from Laravel.
Storage::disk('gae')->files('uploads/')
or
Storage::disk('gae')->get($path)
don't work and I'm getting FileNotFoundException. Am I doing something wrong ?
I have been trying to migrate a Laravel 5.1 app to Google App Engine and have been trying to use your package. I have got this far and I am now struggling to get this to work.
My view displays but I get an error on the page which is
n Filesystem.php line 81
at HandleExceptions->handleError('2', 'file_put_contents(): Exclusive locks may only be set for regular files', '/base/data/home/apps/s~test-unipart/1.386405709774148110/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php', '81', array('path' => 'gs://test-unipart.appspot.com/storage/framework/sessions/e1dd19bc161877084c1af230408ee313ccd602bf', 'contents' => 'eyJpdiI6ImZGODkxdFgyVFl5bFgxcnZraXZ1MFgrdkFjMU9LUkdWSHNmQ2NhbUVCTU09IiwidmFsdWUiOiIraXByclZrRzliTzlRazVRTGk0dmV4N1FSc29FdmpoeXpnV2tZKzkzSHJxN3lCamNYdGRvYk1lRXY1WnphU0hxWjRLd2g5Nit4ZE1IbUFoVEFUaE82bGc1WU8wZllNT0o2TWNNTzlpVTZhYWY1eWZqXC85cUlqUlUxRW1XK2VGTVhPaXBuRk1SeTZiVFBmRXhKdlBVNmJJekcxWXlFbFJINUlDR2kyRVppc0kxMDdPM1lISG1LZXUzYVwvQTFRdFpBdlNOZkNPNFNWVnpNdVwvRUpmU2lBNFR1S2ZJSlMxS2JrMVlYcEpHbUhhXC9rTVJZMkQzTG1VWXR6MURKbG9qa2YyOTJoXC9HRnhlUHN5M2JUQ2lzSTNVaXMwN1QyMTBQeGdOVGUzY1o1dFVBYmpTNkxlckxYUjF1U1oxVkI4Wk5NeThSQllyekZFbTVUWGhLb1VVK3RWWXVjKzRJcjJicTZJbkRiYUlCUTh3Ykl4dHFweUhjODhvNWFOeUd2RWdGK3k2NCIsIm1hYyI6ImUyMjdmZjg3ZmIwMjkxYzkwOTc2OTQ5M2EyMTRlOGRjMjI0NDIzZTgyZGM4OTM2MjdlMWVhYTE1MWQ4YTFkMzgifQ==', 'lock' => true))
at file_put_contents('gs://test-unipart.appspot.com/storage/framework/sessions/e1dd19bc161877084c1af230408ee313ccd602bf', 'eyJpdiI6ImZGODkxdFgyVFl5bFgxcnZraXZ1MFgrdkFjMU9LUkdWSHNmQ2NhbUVCTU09IiwidmFsdWUiOiIraXByclZrRzliTzlRazVRTGk0dmV4N1FSc29FdmpoeXpnV2tZKzkzSHJxN3lCamNYdGRvYk1lRXY1WnphU0hxWjRLd2g5Nit4ZE1IbUFoVEFUaE82bGc1WU8wZllNT0o2TWNNTzlpVTZhYWY1eWZqXC85cUlqUlUxRW1XK2VGTVhPaXBuRk1SeTZiVFBmRXhKdlBVNmJJekcxWXlFbFJINUlDR2kyRVppc0kxMDdPM1lISG1LZXUzYVwvQTFRdFpBdlNOZkNPNFNWVnpNdVwvRUpmU2lBNFR1S2ZJSlMxS2JrMVlYcEpHbUhhXC9rTVJZMkQzTG1VWXR6MURKbG9qa2YyOTJoXC9HRnhlUHN5M2JUQ2lzSTNVaXMwN1QyMTBQeGdOVGUzY1o1dFVBYmpTNkxlckxYUjF1U1oxVkI4Wk5NeThSQllyekZFbTVUWGhLb1VVK3RWWXVjKzRJcjJicTZJbkRiYUlCUTh3Ykl4dHFweUhjODhvNWFOeUd2RWdGK3k2NCIsIm1hYyI6ImUyMjdmZjg3ZmIwMjkxYzkwOTc2OTQ5M2EyMTRlOGRjMjI0NDIzZTgyZGM4OTM2MjdlMWVhYTE1MWQ4YTFkMzgifQ==', '2') in Filesystem.php line 81
I understand I can not write to the app engine, but how do I resolve this?
Thanks in advance
In laravel/laravel@8476df5 the environment variable APP_LOG
was introduced.
GaeSupport can now simply adapt it as the replacement is broken as well.
PHP Fatal error: Class 'Memcached' not found in /home/atrauzzi/Development/project/vendor/shpasser/gae-support-l5/src/Shpasser/GaeSupportL5/Storage/CacheFs.php on line 85
This seems to be happening because I'm using artisan while my .env
file configures things for a local GAE development server.
Because it's not currently possible to even run artisan in the GAE environment, would it make sense to disable any behaviour that depends on classes injected by the GAE environments when running via command line?
Caveat: We should be sure to only detect real command line and not get caught detecting when the commands facade is used during a request.
I'm using GaeSupportL5@dev-master
.
Laravel php artisan key:generate
source code: laravel/framework@370ae34
/**
* Generate a random key for the application.
*
* @return string
*/
protected function generateRandomKey()
{
return 'base64:'.base64_encode(random_bytes(
$this->laravel['config']['app.cipher'] == 'AES-128-CBC' ? 16 : 32
));
}
This will generate string like:
base64:DuyGT1doEMYlY/DQ87GedVqH4THPc75U3CSJLCkl6PI=
Which is not compatible with function parse_ini_file
, error message:
[2016-07-02 21:03:33] local.ERROR: exception 'ErrorException' with message 'parse error in project/app/../.env on line 3' in project/vendor/shpasser/gae-support-l5/src/Shpasser/GaeSupportL5/Setup/IniHelper.php:28
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'parse error in ...', 'project/.env', 28, Array)
#1 project/vendor/shpasser/gae-support-l5/src/Shpasser/GaeSupportL5/Setup/IniHelper.php(28): parse_ini_file('project/.env')
#2 project/vendor/shpasser/gae-support-l5/src/Shpasser/GaeSupportL5/Setup/Configurator.php(115): Shpasser\GaeSupportL5\Setup\IniHelper->read('project/.env')
#3 project/vendor/shpasser/gae-support-l5/src/Shpasser/GaeSupportL5/Setup/Configurator.php(56): Shpasser\GaeSupportL5\Setup\Configurator->createEnvProductionFile('project/.env', 'project/.env', NULL, NULL)
#4 project/vendor/shpasser/gae-support-l5/src/Shpasser/GaeSupportL5/Setup/SetupCommand.php(58): Shpasser\GaeSupportL5\Setup\Configurator->configure('gae-app', true, true, NULL, NULL, NULL, NULL)
#5 [internal function]: Shpasser\GaeSupportL5\Setup\SetupCommand->fire()
#6 project/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#7 project/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#8 project/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 project/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 project/vendor/symfony/console/Application.php(791): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 project/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Shpasser\GaeSupportL5\Setup\SetupCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 project/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 project/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 {main}
.env file:
APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:DuyGT1doEMYlY/DQ87GedVqH4THPc75U3CSJLCkl6PI=
APP_URL=http://localhost
Simple solution: remove last =
character.
Getting the following error on Laravel 5.2:
ErrorException in GaeQueue.php line 82:
Undefined property: Shpasser\GaeSupportL5\Queue\GaeQueue::$crypt
Hello,
If I enable memcached in localhost it throws ReflectionException "Class cache does not exist", This same happens while deploying.
The artisan console doesn't seem to work in local development, whenever I try to use it I get the error:
[ErrorException] escapeshellarg() has been disabled for security reasons
I narrowed it down to this line so it looks like it is turned off intentionally?
The reason I want to use it in local development is so that I can upload a file to Cloud Storage (local) when I run php artisan db:seed
. However if I do this from the command line I get the error Unable to find the wrapper "gs" - did you forget to enable it when you configured PHP
.
Just gave laravel5 on GAE a shot after a long break with a fresh blank install and I get this error
ErrorException in Filesystem.php line 81:
file_put_contents(): Exclusive locks may only be set for regular files
Any idea why?
Would you consider creating a Gitter room to discuss about your package ?
In the section Optimizations, I think it's
php artisan route:cache
instead of :
php artisan routes:cache
Given that the local development environment simulates memcache and has a nice interface, what would you say to moving this fine fella outside of the check?
Hi,
I am using laravel 5.2 and got an error while running the setup artisan command. I believe this issue was reported in issue no #45 (Class Dotenv not found).
Has this issue been resolved?
Regards
Used fresh laravel 5 package, ran installation.
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Call to undefined function gae_realpath() in /Users/buccim2/Projects/git/gene/lunch-club/config/view.php on l
ine 31
I have a problem with the instances.
I set GAESupportL5 optimized with the tips of you. I use a F4 instance that supports approximately 15 simultaneous requests per instance and then it does autoscaling. I think is not normal (so few simultaneous requests per instance),did someone happen to this?
The laravel 5 skeleton ships a default "inspire" quote which is scheduled to run hourly. On any artisan command, the scheduler is checked for execution which results in invocation of InspireCommand
which still uses escapeshellarg()
.
Conclusion: One needs to remove the command from the scheduler in app/Console/Kernel
. (I still wonder if this means we cannot have scheduled commands at all).
I'm having some problems with serialization of objects using google app engine push queue.
The problem, I believe, is more related to laravel framework itself rather then this package.
I describe my problem thoroughly at laravel/framework issue tracker.
I just want to highlight something that I found on the plugin's code while debugging my problem.
On the class GaeJob, line 14 more specifically, we have this:
<?php namespace Shpasser\GaeSupportL5\Queue;
use Illuminate\Container\Container;
use Illuminate\Queue\Jobs\Job;
use Illuminate\Contracts\Queue\Job as JobContract;
class GaeJob extends Job implements JobContract {
protected $qaeQueue;
protected $job;
protected $pushed = false;
public function __construct(Container $container,
GaeQueue $gaeQueue,
$job,
$pushed = false)
{
$this->job = $job;
$this->gaeQueue = $gaeQueue;
$this->pushed = $pushed;
$this->container = $container;
}
Notice how the class property is declared as $qaeQueue, but within the controller it is referenced as $this->gaeQueue. I believe this could cause some eventual serialization issues, since the variable inside the controller is being created dynamically, rather than being attributed to the class's property $qaeQueue. I've changed your code and deployed my application again just to see if it would solve my problem and still I was getting the same problems (describe at the laravel framework issue tracker).
What solved my problem, though, was making a change in the laravel framework code. I suggest you to see my issue there for more details.
I have my primiary key (user_id) set to be auto_increment and the datatype is a bigint, 20bits.
However, when I fetch records from database, it is truncated to something else.
The user_id in database is 190000000001(12 digits)
but when I do exit(var_dump(Auth::user())) after Auth::attempt([....]) in AuthController.php, the user_id is truncated to something 9 digits like 109876541.
Describe in more detail the options of the command.
Hello,
I'm trying to setup a Laravel 5.0 project on GAE that uses the push queue for all the normal actions which you could do, and one beanstalkd queue that is running in a VM compute engine.
I need to use this beanstalkd queue for only one very specific task that MUST be run on the VM.
So, inside my Command
class I have this method to push it to my desired queue.
class ProcessSceneImage extends Command implements SelfHandling, ShouldBeQueued {
use InteractsWithQueue, SerializesModels;
... (other content)
public function queue($queue, $command) {
$queue->pushOn('images_queue', $command);
}
... (other content)
}
In my controller, I just dispatch the process like that
$this->dispatch(
new ProcessSceneImage(
$scene_id
, Request::get('type')
)
);
The problem is that the exception that I'm getting suggests that this process was tried to be queued into GAE queue instead of beanstalkd. Below, the stack trace (most recent at the top). The lines 05~07 make me believe that Gae queue is getting in the way somehow.
TaskQueueException in PushQueue.php line 90:
Invalid queue name
01 in PushQueue.php line 90
02 at PushQueue::errorCodeToException('6') in PushQueue.php line 189
03 at PushQueue->addTasks(array(object(PushTask))) in PushTask.php line 292
04 at PushTask->add('images_queue') in GaeQueue.php line 85
05 at GaeQueue->pushRaw('{"job":"Illuminate\\Queue\\CallQueuedHandler@call","data":{"command":"O:30:\"App\\Commands\\ProcessSceneImage\":3:{s:42:\"\u0000App\\Commands\\ProcessSceneImage\u0000i_scene_id\";i:13;s:38:\"\u0000App\\Commands\\ProcessSceneImage\u0000s_type\";s:4:\"flat\";s:6:\"\u0000*\u0000job\";N;}"},"attempts":1,"queue":"images_queue"}', 'images_queue') in GaeQueue.php line 67
06 at GaeQueue->push(object(ProcessSceneImage), '', 'images_queue') in Queue.php line 30
07 at Queue->pushOn('images_queue', object(ProcessSceneImage)) in ProcessSceneImage.php line 59
08 at ProcessSceneImage->queue(object(GaeQueue), object(ProcessSceneImage)) in Dispatcher.php line 256
09 at Dispatcher->dispatchToQueue(object(ProcessSceneImage)) in Dispatcher.php line 181
10 at Dispatcher->dispatch(object(ProcessSceneImage)) in DispatchesCommands.php line 15
11 at WebController->dispatch(object(ProcessSceneImage)) in SceneController.php line 112
12 at SceneController->store('2')
13 at call_user_func_array(array(object(SceneController), 'store'), array('pano' => '2')) in Controller.php line 246
14 at Controller->callAction('store', array('pano' => '2')) in ControllerDispatcher.php line 162
15 at ControllerDispatcher->call(object(SceneController), object(Route), 'store') in ControllerDispatcher.php line 107
16 at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
17 at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
18 at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
19 at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
20 at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 108
21 at ControllerDispatcher->callWithinStack(object(SceneController), object(Route), object(Request), 'store') in ControllerDispatcher.php line 67
22 at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Web\SceneController', 'store') in Route.php line 204
23 at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
24 at Route->run(object(Request)) in Router.php line 701
25 at Router->Illuminate\Routing\{closure}(object(Request))
26 at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
27 at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
28 at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
29 at Pipeline->then(object(Closure)) in Router.php line 703
30 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 670
31 at Router->dispatchToRoute(object(Request)) in Router.php line 628
32 at Router->dispatch(object(Request)) in Kernel.php line 214
33 at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
34 at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
35 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 43
36 at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 20
37 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 125
38 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 55
39 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
40 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 61
41 at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
42 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36
43 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125
44 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 40
45 at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125
46 at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
47 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125
48 at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
49 at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
50 at Pipeline->then(object(Closure)) in Kernel.php line 115
51 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
52 at Kernel->handle(object(Request)) in index.php line 53
My .env file looks like this (for debugging)
APP_ENV=production
APP_DEBUG=true
APP_KEY=random_string
BEANSTALKD_HOST=xxx.xxx.xx.xxx (my VM IPv4 IP)
DB_CONNECTION=cloudsql
CLOUD_SQL_SOCKET=/cloudsql/<project-id>
CLOUD_SQL_DATABASE=<database_name>
CLOUD_SQL_USERNAME=root
CLOUD_SQL_PASSWORD=
CACHE_DRIVER=memcached
SESSION_DRIVER=memcached
QUEUE_DRIVER=gae
MAIL_DRIVER=gae
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=
LOG_HANDLER=syslog
FILESYSTEM=gae
CACHE_SERVICES_FILE=false
CACHE_CONFIG_FILE=false
CACHE_ROUTES_FILE=false
CACHE_COMPILED_VIEWS=false
My queue config file looks like this
'default' => env('QUEUE_DRIVER', 'sync'),
'connections' => [
'gae' => [
'driver' => 'gae',
'queue' => 'default',
'url' => '/tasks',
'encrypt' => true,
],
'sync' => [
'driver' => 'sync',
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_HOST'),
'queue' => 'default',
'ttr' => 60,
],
'images_queue' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_HOST'),
'queue' => 'images_queue',
'ttr' => 60,
],
],
'failed' => [
'database' => 'mysql', 'table' => 'failed_jobs',
],
I'm getting out of hope at this point. Could someone give me a hand here?
I try to deploy my laravel app on GAE from VPS. Before that I never have the experience of developing app this type of cloud platform..
Elixir build files is not accessed on GAE. But It works very well on SDK...
file_get_contents(/base/data/home/apps/e~durumum-n/1.387870649534001545/public/build/rev-manifest.json): failed to open stream: No such file or directory (View: /base/data/home/apps/e~durumum-n/1.387870649534001545/resources/views/welcome.blade.php)
out of Stack Trace:
in helpers.php line 273
at CompilerEngine->handleViewException(object(ErrorException), '0') in PhpEngine.php line 44
at PhpEngine->evaluatePath('cachefs://framework/views/eb3063d30de407e04a4541d580f56662', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag))) in CompilerEngine.php line 58
at CompilerEngine->get('/base/data/home/apps/e~durumum-n/1.387870649534001545/resources/views/welcome.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag))) in View.php line 135
at View->getContents() in View.php line 106
at View->renderContents() in View.php line 80
at View->render() in Response.php line 51
at Response->setContent(object(View)) in Response.php line 202
at Response->__construct(object(View)) in Router.php line 1225
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 113
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(Home), object(Route), object(Request), 'index') in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Home', 'index') in Route.php line 203
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 704
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 706
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
at Router->dispatchToRoute(object(Request)) in Router.php line 631
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
My app.yml
application: myapp
version: 1
runtime: php55
api_version: 1
handlers:
- url: /favicon\.ico
static_files: public/favicon.ico
upload: public/favicon\.ico
- url: /css
static_dir: public/css
- url: /assets
static_dir: public/assets
- url: /js
static_dir: public/js
- url: /build
static_dir: public/build
- url: /.*
script: public/index.php
skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\.(?!env).*$
- ^(.*/)?node_modules.*$
- ^(.*/)?bower_components.*$
- ^(.*/)?vendor/almasaeed2010/.*$
- ^(.*/)?_ide_helper\.php$
- ^(.*/)?\.DS_Store$
- ^(.*/)?nbproject.*$
env_variables:
GAE_SKIP_GCS_INIT: true
What can I do?
Although this may be nothing to do with your code, do you have any tips for speed on gae?
I have a vps and gae running the same code and the vps averages 200ms response times, where as app engine averages 1000ms to 2500ms! And doesn't seem very consistent.
I've tried route caching and artisan optimize but they just my the vps speed up even more, no change to gae even on the F4 instances.
Regards,
Adam
Hi,
Maybe its good to add the below parameters to the app.yaml file?
default_expiration: "14d"
threadsafe: true
When running on GAE you might get this exclusive file lock error in Laravel v5.1.44. To fix this edit:
"vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php", goto line 81:
Change: LOCK_EX to LOCK_SH
Update your GAE code and your good to go.
I noticed this in the docs: The migrations are supported while working in local environment only.
Might be helpful to detail alternatives so that people can run their migrations. Perhaps there's an opportunity for a special migration task to be included in the library? Then people could trigger or queue the job on deploy.
How can I embed images which are stored in Google Storage onto my Views?
I was trying to update my Laravel app to recently released 5.1 version but GaeSupportL5 dependency on illuminate/support 5.0.* blocked the update.
Composer response:
$>composer update Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - Conclusion: don't install laravel/framework v5.1.1 - shpasser/gae-support-l5 1.2.1 requires illuminate/support 5.0.* -> satisfiable by laravel/framework[v5.0.32], illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5. 0.33, v5.0.4]. - shpasser/gae-support-l5 1.0 requires illuminate/support 5.0.* -> satisfiable by laravel/framework[v5.0.32], illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0. 33, v5.0.4]. - shpasser/gae-support-l5 1.1 requires illuminate/support 5.0.* -> satisfiable by laravel/framework[v5.0.32], illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0. 33, v5.0.4]. - shpasser/gae-support-l5 1.1.1 requires illuminate/support 5.0.* -> satisfiable by laravel/framework[v5.0.32], illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5. 0.33, v5.0.4]. - shpasser/gae-support-l5 1.1.2 requires illuminate/support 5.0.* -> satisfiable by laravel/framework[v5.0.32], illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5. 0.33, v5.0.4]. - shpasser/gae-support-l5 1.2 requires illuminate/support 5.0.* -> satisfiable by laravel/framework[v5.0.32], illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0. 33, v5.0.4]. - shpasser/gae-support-l5 1.2.1 requires illuminate/support 5.0.* -> satisfiable by laravel/framework[v5.0.32], illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5. 0.33, v5.0.4]. - Can only install one of: laravel/framework[v5.1.0, v5.0.32]. - don't install illuminate/support v5.0.0|don't install laravel/framework v5.1.0 - don't install illuminate/support v5.0.22|don't install laravel/framework v5.1.0 - don't install illuminate/support v5.0.25|don't install laravel/framework v5.1.0 - don't install illuminate/support v5.0.26|don't install laravel/framework v5.1.0 - don't install illuminate/support v5.0.28|don't install laravel/framework v5.1.0 - don't install illuminate/support v5.0.33|don't install laravel/framework v5.1.0 - don't install illuminate/support v5.0.4|don't install laravel/framework v5.1.0 - Installation request for laravel/framework 5.1.* -> satisfiable by laravel/framework[v5.1.0, v5.1.1]. - Installation request for shpasser/gae-support-l5 1.* -> satisfiable by shpasser/gae-support-l5[1.0, 1.1, 1.1.1, 1.1.2, 1.2, 1.2.1].
Hello,
I'm trying to use the support package (I'm using the last commit on dev-master) but can't figure out how to get it working on the development server.
For comparison, I have set up a vhost and it works but when running it with the development server, I have this error :
ErrorException in Filesystem.php line 74:
file_put_contents({project_folder}/storage/framework/views/7c11e7f8cc1fcffb56a1755ae0ee5b19): The local filesystem is readonly, open failed
So, is the support package supposed to be working with development server? If so, do you have any idea why I have this error ?
Thank you!
If I'm correct in reading the current code, it looks like the first bucket configured in php.ini is the one that this package uses.
Would it be worthwhile to allow the bucket used to be configured at a driver/L5 filesystem level?
I am getting following error while running
php artisan gae:setup --config --cache-config --bucket="your-bucket-id" --db-socket="cloud-sql-instance-socket-connection-string" --db-name="cloud-sql-database-name" app-id
PHP Fatal error: Class 'Dotenv' not found in /var/www/anglist/vendor/shpasser/gae-support-l5/src/Shpasser/GaeSupportL5/Setup/Configurator.php on line 69
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Dotenv' not found
I am using Laravel 5.2
/urlfetch.Fetch
RPCs: 17
ms: 2734
Is it supposed to be this slow in production or am I doing something wrong?
I'm using laravel 5.2.
When I try to generate the GAE related files, it creates the .env.local file, then throws an error of:
ErrorException] preg_replace(): Compilation failed: PCRE does not support \L, \1, \N{name}, \U, or \u at offset 4
Any ideas of how to fix this?
Hello
After successfully installing your plugin, my website deployed successfully to GAE.
I'm able to migrate my tables in the Google Cloud Storage.
When I now try to register, the Monolog is trying to export a logfile in /storage/logs
I found this post with almost the same issues:
#18
I tried to find useful configuration settings, unfortunately without success.
I'm running Laravel 5.1 and your GaeSupportL5 as of today.
Stacktrace in the GAE log:
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "gs://p-app/storage/logs/laravel.log" could not be opened: failed to open stream: "\google\appengine\ext\cloud_storage_streams\CloudStorageStreamWrapper::stream_open" call failed' in /base/data/home/apps/epingvalue-app/dev-001.388656046154908935/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87p-app/dev-001.388656046154908935/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\StreamHandler->write(Array)
Stack trace:
#0 /base/data/home/apps/e
#1 /base/data/home/apps/ep-app/dev-001.388656046154908935/vendor/monolog/monolog/src/Monolog/Logger.php(289): Monolog\Handler\AbstractProcessingHandler->handle(Array)p-app/dev-001.388656046154908935/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array)
#2 /base/data/home/apps/e
#3 /base/data/home/apps/ep-app/dev-001.388656046 in /base/data/home/apps/ep-app/dev-001.388656046154908935/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 87
I have this code in my AuthController,
if(Auth::attempt([....]) {
Session::save();
return Redirect::to('acesome/dashboard');
}
Running this code lead to this error:
production.ERROR: exception 'ErrorException' with message 'Undefined index: _sf2_meta' in /vendor/laravel/framework/src/Illuminate/Session/Store.php:286
Any idea?
When creating a queue job, I noticed that values are getting truncated. Looking into this further, it appears as though PHP inserts \x00
before private variables when using serialize
.
Because Laravel depends on serialize
functionality, it might be best if GaeQueue
did a base64_encode
when queueing and then a base64_decode
when marshalling. That way they won't cause parse errors when laravel calls unserialize
.
The error occurs when I execute any artisan command through the endpoint (which is logical to me).
Is this expected behaviour? The function is disabled in AppEngine and as far as I can tell it ever was.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.