The /tmp/storage/bootstrap/cache directory must be present and writable. (View: /var/task/resources/views/emails/new/daily-schedule.blade.php) #962
Unanswered
jbirch8865
asked this question in
Support
Replies: 1 comment 2 replies
-
Hi, could you tell us which version of Bref and the Laravel Bridge (https://github.com/brefphp/laravel-bridge) you have installed? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having multiple issues with the /tmp directory after my most recent serverless deployment. I wasn't having any issues for the past few months and then upgraded to the latest Bref release. I also started adding front-end views which I wasn't previously using. I have two consistent issues at the moment. One is the description of this bug. The other is if I include a route that is built like this
Route::view('/unauthenticated/dashboard','dashboards.dashboard',['dates' => app(\App\Services\DispatchService::class)->getDispatchingDays()]);
I get a similar error that says "file_put_contents(/var/task/storage/framework/cache/facade-9c27fd870e905e043c32811615adb1fc353d893e.php): Failed to open stream: No such file or directory"
I'm guessing something isn't being set right during the deployment to properly move the storage and caches to the /tmp directory but I'm at a loss for what to do.
If it helps here is a log of the deployment:
jbirch8865@DESKTOP-7A6N9GI:/mnt/c/Users/jbirc/code/dispatch_api$ serverless deploy
Serverless: Deprecation warning: Detected ".env" files. In the next major release variables from ".env" files will be automatically loaded into the serverless build process. Set "useDotenv: true" to adopt that behavior now.
More Info: https://www.serverless.com/framework/docs/deprecations/#LOAD_VARIABLES_FROM_ENV_FILES
Serverless: Deprecation warning: Starting with version 3.0.0, following property will be replaced:
"provider.iamRoleStatements" -> "provider.iam.role.statements"
More Info: https://www.serverless.com/framework/docs/deprecations/#PROVIDER_IAM_SETTINGS
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service dispatch.zip file to S3 (38.36 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
................................
Serverless: Stack update finished...
Service Information
service: dispatch
stage: dev
region: us-west-2
stack: dispatch-dev
resources: 31
api keys:
None
endpoints:
ANY - https://me43oaoyd3.execute-api.us-west-2.amazonaws.com/dev
ANY - https://me43oaoyd3.execute-api.us-west-2.amazonaws.com/dev/{proxy+}
ANY - https://gu5ckxj4m6.execute-api.us-west-2.amazonaws.com
functions:
web: dispatch-dev-web
artisan: dispatch-dev-artisan
aggregate: dispatch-dev-aggregate
worker: dispatch-dev-worker
layers:
None
Serverless: Removing old service artifacts from S3...
And here is my serverless.yml
service: dispatch
provider:
lambdaHashingVersion: 20201221
name: aws
The AWS region in which to deploy (us-east-1 is the default)
region: us-west-2
The stage of the application, e.g. dev, production, staging… ('dev' is the default)
stage: dev
runtime: provided.al2
vpc:
securityGroupIds:
- sg-036f5cdc0ca84ff88
subnetIds:
- subnet-083d31b93d87a77f6
- subnet-0ee565742c26c9143
environment:
SQS_QUEUE: !Ref AlertQueue
FILESYSTEM_DRIVER: s3
DB_CONNECTION: mysql
DB_HOST: redacted
DB_PORT: redacted
DB_DATABASE: redacted
DB_USERNAME: redacted
DB_PASSWORD: redacted
AWSDEFAULT_REGION: us-west-2
AWSBUCKET: dhtcps
TWILIO_FROM: redacted
TWILIO_ACCOUNT_SID: redacted
TWILIO_AUTH_TOKEN: redacted
testing_to_number: redacted
iamRoleStatements:
# Allows our code to interact with SQS
- Effect: Allow
Action: [sqs:SendMessage, sqs:DeleteMessage]
Resource: !GetAtt AlertQueue.Arn
package:
Directories to exclude from deployment
patterns:
- '!node_modules/'
- '!public/storage'
- '!resources/assets/'
- '!storage/'
- '!tests/'
- '!.env'
functions:
This function runs the Laravel website/API
web:
handler: public/index.php
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
layers:
- ${bref:layer.php-80-fpm}
events:
- http: "ANY /"
- http: "ANY /{proxy+}"
- httpApi: '*'
This function lets us run artisan commands in Lambda
artisan:
handler: artisan
timeout: 120 # in seconds
layers:
- ${bref:layer.php-80} # PHP
- ${bref:layer.console} # The "console" layer
aggregate:
handler: SchedulerService.php
timeout: 60
layers:
- ${bref:layer.php-80}
events:
- schedule:
rate: rate(1 minute)
enabled: true
worker:
handler: worker.php
layers:
- ${bref:layer.php-80}
events:
# Declares that our worker is triggered by jobs in SQS
- sqs:
arn: !GetAtt AlertQueue.Arn
# If you create the queue manually, the line above could be:
# arn: 'arn:aws:sqs:us-east-1:1234567890:my_sqs_queue'
# Only 1 item at a time to simplify error handling
batchSize: 1
resources:
Resources:
plugins:
We need to include the Bref plugin
I have for sure used php artisan cache:clear as well as
php artisan config:cache
php artisan route:clear
php artisan config:clear
php artisan view:clear
Beta Was this translation helpful? Give feedback.
All reactions