Some strange behavior and haven't found anything related to this on the internet,
But composer and yarn can just create folders and files fine
when when preparing the db-seeding task it can't create storage/logs/laravel.log
same result Permission denied on writing to laravel.log
and want to make sure if its just me or something weird going on
This gitlab-ci is run on gitlab-runner 14.4.0
Isolated test:
composer and yarn task run fine with no issues
stages:
- preparation
- building
- testing
- security
- deployment
image: edbizarro/gitlab-ci-pipeline-php:8.0
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
# Variables
variables:
DOCKER_DRIVER: overlay2
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
DB_HOST: mysql
db-seeding:
stage: building
only: [master,merge_requests]
services:
- name: mariadb:latest
alias: mysql
command: ["--default-authentication-plugin=mysql_native_password"]
# Download the artifacts for these jobs
dependencies:
- composer
- yarn
script:
- mysql --version
- cat .env
- php artisan key:generate
- php artisan migrate:fresh --seed
- mysqldump --host="${DB_HOST}" --user="root" --password="${MYSQL_ROOT_PASSWORD}" "${MYSQL_DATABASE}" > db.sql
artifacts:
paths:
- storage/logs # for debugging
- db.sql
expire_in: 1 days
when: always
Result:
Using Docker executor with image edbizarro/gitlab-ci-pipeline-php:8.0 ...
Starting service mariadb:latest ...
Authenticating with credentials from /root/.docker/config.json
Pulling docker image mariadb:latest ...
Using docker image sha256:e2278f24ac88b82f98ef58de4bf15c0b01df3de2f1fe835e2ea4350282d58700 for mariadb:latest with digest mariadb@sha256:0f04ae6f30c5a3295fb7cc9be5780c15ff21d6028f999b19f5803114c1e8559e ...
Waiting for services to be up and running...
Authenticating with credentials from /root/.docker/config.json
Pulling docker image edbizarro/gitlab-ci-pipeline-php:8.0 ...
Using docker image sha256:128ada835f635a90593675a31811614fcd9d0158e405c7feb1f946ac14d8e28d for edbizarro/gitlab-ci-pipeline-php:8.0 with digest edbizarro/gitlab-ci-pipeline-php@sha256:0ad80b6099eb2f29794c99675162053e561bc1646a235f38eaa04af87c0a0040 ...
Preparing environment
00:01
Running on runner--zd75qdn-project-287-concurrent-0 via gitlab-runner...
Getting source from Git repository
00:01
Fetching changes with git depth set to 1...
Reinitialized existing Git repository in /builds/GravityStore/siteng/.git/
Checking out 9d5231e6 as refs/merge-requests/181/head...
Removing .env
Removing node_modules/
Removing public/css/
Removing public/js/
Removing public/mix-manifest.json
Removing vendor/
Skipping Git submodules setup
Downloading artifacts
00:08
Downloading artifacts for composer (12451)...
Downloading artifacts from coordinator... ok id=12451 responseStatus=200 OK token=YzKR2Ush
Downloading artifacts for yarn (12452)...
Downloading artifacts from coordinator... ok id=12452 responseStatus=200 OK token=iw-2_pgL
Executing "step_script" stage of the job script
00:00
Using docker image sha256:128ada835f635a90593675a31811614fcd9d0158e405c7feb1f946ac14d8e28d for edbizarro/gitlab-ci-pipeline-php:8.0 with digest edbizarro/gitlab-ci-pipeline-php@sha256:0ad80b6099eb2f29794c99675162053e561bc1646a235f38eaa04af87c0a0040 ...
$ mysql --version
mysql Ver 15.1 Distrib 10.3.27-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
$ cat .env
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
DEBUGBAR_ENABLED=true
LARAVEL_PAGE_SPEED_ENABLE=false
APP_URL=http://localhost
LOG_CHANNEL=single
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_STORE=file
SESSION_LIFETIME=3600
SESSION_COOKIE=donationcontrol-session
SESSION_DOMAIN=dashboard.donationcontrol.test
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
$ php artisan key:generate
In StreamHandler.php line 146:
The stream or file "/builds/GravityStore/siteng/storage/logs/laravel.log" c
ould not be opened in append mode: Failed to open stream: Permission denied
$ touch storage/logs/laravel.log
touch: cannot touch 'storage/logs/laravel.log': Permission denied
Uploading artifacts for failed job
00:01
Uploading artifacts...
storage/logs: found 2 matching files and directories
WARNING: db.sql: no matching files
Uploading artifacts as "archive" to coordinator... ok id=12456 responseStatus=201 Created token=-Cb3vVH5
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Some strange behavior and haven't found anything related to this on the internet, But composer and yarn can just create folders and files fine when when preparing the db-seeding task it can't create storage/logs/laravel.log
also tried to clear my whole gitlab-ci with this: https://github.com/edbizarro/gitlab-ci-pipeline-php#laravel-dusk-tests-gitlab-ciyml-using-mysql-service-and-cache
same result Permission denied on writing to laravel.log
and want to make sure if its just me or something weird going on
This gitlab-ci is run on gitlab-runner 14.4.0
Isolated test: composer and yarn task run fine with no issues
Result: