lorisleiva / laravel-docker

🐳 Generic docker image for Laravel Applications
MIT License
934 stars 314 forks source link

Segmentation fault with 7.1 #25

Closed Tisseur2Toile closed 5 years ago

Tisseur2Toile commented 5 years ago

Hello,

I'm very new to Gitlab CI and I found your article great. Although I tried to setup a simple gitlab CI using the 7.1 (as I want my project to be compatible with this version of PHP), I setup the Gitlab CI yml like this :

image: lorisleiva/laravel-docker:7.1

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - vendor/

phpunit:
  stage: test
  script:
    - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
    - cp .env.example .env
    - php artisan key:generate
    - phpunit --coverage-text --colors=never

In this case (using 7.1 instead of latest) the test suite failed returning a Segmentation fault If I switch 7.1 for latest everything is working fine, did I do something wrong ?

lorisleiva commented 5 years ago

Hi there 👋

I'm sorry to hear that. I haven't tested those specific images myself yet so I'm not sure what is going wrong.

Could you please provide more information on the error message?

Is anyone else having this issue?

Tisseur2Toile commented 5 years ago

Hello,

I haven't try with 7.2 yet. This is a log I Received in the console (I just removed come installation and composer suggestions lines).

Running with gitlab-runner 11.8.0 (4745a6f3)
  on docker-auto-scale 0277ea0f
Using Docker executor with image lorisleiva/laravel-docker:7.1 ...
Pulling docker image lorisleiva/laravel-docker:7.1 ...
Using docker image sha256:b7d6e54837ee35cac3dca327a5f1ff889126b48a8b06a7b92476cacad14198bf for lorisleiva/laravel-docker:7.1 ...
section_start:1551781756:prepare_script
Running on runner-0277ea0f-project-11155434-concurrent-0 via runner-0277ea0f-srm-1551781665-e531452e...
section_end:1551781762:prepare_script
section_start:1551781762:get_sources
Cloning repository...
Cloning into '/builds/tisseur2toile1/laravel-pipeline'...
Checking out 1cab9862 as master...
Skipping Git submodules setup
section_end:1551781764:get_sources
section_start:1551781764:restore_cache
Checking cache for master...
FATAL: file does not exist                         
Failed to extract cache
section_end:1551781766:restore_cache
section_start:1551781766:download_artifacts
section_end:1551781768:download_artifacts
section_start:1551781768:build_script
$ composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 74 installs, 0 updates, 0 removals
  - Installing doctrine/inflector (v1.3.0): Downloading (100%)

psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing ext-soap (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
Generating optimized autoload files
$ cp .env.example .env
$ php artisan key:generate
Application key set successfully.
$ phpunit --coverage-text --colors=never
PHPUnit 7.5.6 by Sebastian Bergmann and contributors.

/bin/bash: line 80:   170 Segmentation fault      (core dumped) phpunit --coverage-text --colors=never
section_end:1551781791:build_script
section_start:1551781791:after_script
section_end:1551781792:after_script
section_start:1551781792:upload_artifacts_on_failure
section_end:1551781794:upload_artifacts_on_failure
ERROR: Job failed: exit code 1

lorisleiva commented 5 years ago

I just googled your error message and found these:

It looks like segmentation faults are only happening on the PHP side. Thus it must be that it works on your local machine but not on the GitLab runners because of the memory allocated.

If I was you I would remove all my tests and create a dummy one to see if we get passed the seg fault and then re-add the tests one-by-one to see the one that is potentially causing troubles.

In any case it's very likely something to do with your code base and not this docker image. I'm closing this issue for the moment and will reopen it if you find something new.

I hope this helps. 🙂

Tisseur2Toile commented 5 years ago

Hello, Thanks for the help, I will have a look at that. It is very Strange as I do not have any tests right now on this repo (just the basic examples).