Trouble Generating PHPStan Baseline in Docker: Need Help! #11715
Replies: 4 comments 8 replies
-
|
Hi, there's no reason for this to happen. This is usually a permission issue on your disk / in the image. Try to look into the permissions in If it's happening inside Docker, it should be easy for you to replicate this publicly so I can take a look. |
Beta Was this translation helpful? Give feedback.
-
|
I'm observing this frequently as well. Running docker exec --interactive --tty intranet-php vendor/bin/phpstan --allow-empty-baseline --configuration=phpstan.neon --
generate-baseline=phpstan-baseline.neon --memory-limit=-1yields My includes:
- phpstan-baseline.neon
parameters:
disallowedFunctionCalls:
- function: 'dd()'
- function: 'dump()'
- function: 'eval()'
- function: 'exec()'
- function: 'passthru()'
- function: 'phpinfo()'
- function: 'print()'
- function: 'print_r()'
- function: 'proc_open()'
- function: 'ray()'
- function: 'shell_exec()'
- function: 'system()'
- function: 'var_dump()'
- function: 'xr()'
allowIn:
- src/Twig/Functions/Debug.php
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
excludePaths:
- 'src/Controller/TestController.php'
level: 6
paths:
- bin/console
- src
- tests
phpVersion: 80200
reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false
tmpDir: .build/phpstan/
type_coverage:
declare: 90
param: 90
property: 90
return: 90Running composer show | grep phpstanyields My # https://docs.docker.com/compose/compose-file/compose-file-v3/
services:
intranet-apache:
build: .docker/apache
container_name: "intranet-apache"
depends_on:
intranet-php:
condition: "service_started"
networks:
backend:
ipv4_address: 172.20.0.6
ports:
- "80:80"
volumes:
- ./:/var/www/html:ro
- .docker/apache/apache-vhost.conf:/usr/local/apache2/conf/extra/httpd-vhosts.conf
- apache_logs:/var/log/apache2
intranet-mariadb:
build: .docker/mariadb
container_name: "intranet-mariadb"
environment:
MYSQL_DATABASE: "intranet_dev"
MYSQL_ROOT_PASSWORD: "root"
TZ: "Europe/Berlin"
networks:
backend:
ipv4_address: 172.20.0.2
platform: "linux/amd64"
ports:
- "3306:3306"
volumes:
#- ".docker/mariadb/conf.d/:/etc/mysql/conf.d/"
- ".docker/mariadb/var/:/var/lib/mysql/:rw"
intranet-mariadb-test:
build: .docker/mariadb
container_name: "intranet-mariadb-test"
environment:
MYSQL_DATABASE: "intranet_test"
MYSQL_ROOT_PASSWORD: "root"
TZ: "Europe/Berlin"
networks:
backend:
ipv4_address: 172.20.0.3
platform: "linux/amd64"
ports:
- "3307:3306"
volumes:
- ".docker/mariadb/conf.d/:/etc/mysql/conf.d/"
- ".docker/mariadb-test/var/:/var/lib/mysql/:rw"
intranet-php:
build:
context: .docker/php
args:
USER_ID: ${UID:-1000}
GROUP_ID: ${GID:-1000}
container_name: "intranet-php"
depends_on:
intranet-mariadb:
condition: "service_started"
intranet-redis:
condition: "service_started"
environment:
- APACHE_RUN_USER=#${UID:-1000}
- APACHE_RUN_GROUP=#${GID:-1000}
networks:
backend:
ipv4_address: 172.20.0.4
volumes:
- ./:/var/www/html
- .docker/.bash_aliases:/home/appuser/.bash_aliases
- .docker/.bash_aliases:/root/.bash_aliases
- php_fpm_logs:/var/log/php-fpm
intranet-redis:
container_name: "intranet-redis"
command: "redis-server /usr/local/etc/redis/redis.conf"
environment:
TZ: "Europe/Berlin"
image: "redis:7.2.1"
networks:
backend:
ipv4_address: 172.20.0.5
platform: "linux/amd64"
ports:
- "6379:6379"
volumes:
- ".docker/redis/var/:/data"
- ".docker/redis/redis.conf:/usr/local/etc/redis/redis.conf"
volumes:
apache_logs:
php_fpm_logs:
networks:
backend:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24 |
Beta Was this translation helpful? Give feedback.
-
|
Encountering the same issue as @localheinz (in the same codebase 😅). Problem still seems to be: Running in a single process avoids the issue. I assume @staabm's assumption (assumption inception?) is correct, that it's some kind of race condition. Is there some way of starting to debug this? |
Beta Was this translation helpful? Give feedback.
-
|
We encountered this error. In our project, running in docker, the PHPStan It seems that creating a dedicated docker volume ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having an issue while trying to generate a baseline. I'm running PHPStan within Docker, which works fine, but when I attempt to generate the baseline, it fails with the following error:
I'm not sure if I'm doing something wrong. Does anyone have suggestions or ideas about what might be causing this?
Beta Was this translation helpful? Give feedback.
All reactions