Closed digitalhuman closed 7 years ago
This change does not seem right to me for several reasons:
file_put_contents()
does not accept LOCK_SH parameter according to PHP docs,flock()
to acquire a reader
lock, but put()
is a write operation,put()
function is required to lock the file exclusively it would be incorrect to ignore the lock
parameter.Anyway, I would be interested to know how to reproduce the issue in order to try to understand whether something could be done in order to prevent it from happening.
Interesting thing. I guess its just not documented cause it actually does work. Anyway;
Assuming you have a project in GAE, a valid Bucket and MySQL DB etc etc setup and working.
1) Started with a clean Larvel v5.1.44 clone created with composer. 2) Then added "shpasser/gae-support-l5": "~1.0" 3) composer update 4) added Shpasser\GaeSupportL5\GaeSupportServiceProvider::class 5) 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" --db-host="cloud-sql-instance-ipv4-address" app-id 6) Copied .env-production to .env 7) appcfg.py update ./
Thats what I did and the error occurred. After changing it to LOCK_SH stuff worked fine.
Could you please add the log messages with the stack trace?
I also have the same problem.
In this case a wrong .env
file is being used since Laravel uses file
session driver. While running on GAE memcached
session driver is the appropriate one.
BTW, locks are not supported on GCS buckets. https://cloud.google.com/appengine/docs/php/googlestorage/advanced
Please check the status of the issue after my latest reply. If indeed the issue was caused by a wrong .env
file I would like to close it.
I'm using memcached. Here is my .env.
APP_ENV=production APP_DEBUG=false APP_KEY=APP_KEY DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret CACHE_DRIVER=memcached SESSION_DRIVER=memcached QUEUE_DRIVER=gae REDIS_HOST=127.0.0.1 REDIS_PASSWORD= REDIS_PORT=6379 MAIL_DRIVER=gae MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME= MAIL_PASSWORD= MAIL_ENCRYPTION= APP_LOG=syslog FILESYSTEM=gae CACHE_SERVICES_FILE=false CACHE_CONFIG_FILE=false CACHE_ROUTES_FILE=false CACHE_COMPILED_VIEWS=false
The only other option is that you have a cached config with wrong parameters. Please try to remove bootstrap/cache/config.php
and then push your app to GAE. If the suggested way works you will have to cache the configuration again using gae:setup
command.
You were spot on! Thank you!
I had the same "exclusive locks" issue and shpasser's solution worked for me as well. I removed bootstrap/cache/config.php
and deployed the app, which worked. Then I ran the gae:setup
command again, overwrote the files when prompted, deployed the app and it is still working. Thank you!
It seems like a good time to close this one.
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.