tobybatch / kimai2

Docker containers for the kimai2 web application including docker-compose and kubernetes/helm deployment.
MIT License
181 stars 96 forks source link

Error running composer #39

Closed tobybatch closed 5 years ago

tobybatch commented 5 years ago

@kevinpapst We are getting this error running composer install --working-dir=/opt/kimai --optimize-autoloader

It's during the docker creation process, and I can't replicate it if shell on and run the command. Can you offer any pointers as to where I can investigate?

#33 21.44 Generating optimized autoload files
#33 22.73 ocramius/package-versions:  Generating version class...
#33 22.73 ocramius/package-versions: ...done generating version class
#33 22.75 Executing script cache:clear [KO]
#33 23.84  [KO]
#33 23.84 Script cache:clear returned with error code 1
#33 23.84 !!  
#33 23.84 !!  In srcApp_KernelProdContainer.php line 1976:
#33 23.84 !!                                                                   
#33 23.84 !!    The parameter "!k(MISSING)ernel.project_dir" must be defined.  
#33 23.84 !!                                                                   
#33 23.84 !!  
#33 23.84 !!  
#33 23.84 Script @auto-scripts was called via post-install-cmd
Schrolli91 commented 5 years ago

btw - we do exactly the same, but on my machine its building fine

kevinpapst commented 5 years ago

Does it really look exactly like this The parameter "!k(MISSING)ernel.project_dir" must be defined? Looks wrong in multiple way. Does that happen in a fresh clone as well? It is a parameter defined by Symfony itself in vendor/symfony/http-kernel/Kernel.php around line 342

Schrolli91 commented 5 years ago

The docker build clones the kimai repo from scratch, yes

kevinpapst commented 5 years ago

So on one machine it works, on the other one it doesn't? Whats the difference between these machines?

The !k(MISSING)ernel.project_dir looks like a copy & paste problem. Are you sure there is no local.yaml or some plugin that defines a variable and uses the %kernel.project_dir%?

I have no clue, I can just tell you where it is defined and what it is defined for. I never experienced any problem with it.

Schrolli91 commented 5 years ago

The only difference to your described installation in the docs is that we pre install the prestissimo Plugin to improve deps install speed from composer. And this will removed automatically on the composer install because it's not in the deps file.

Maybe that's a problem?

My machine is a Linux mint 19.2, idk what toby is using.

kevinpapst commented 5 years ago

Maybe.

Symfony Flex already brings composer parallel downloads (if curl-multi is installed). Thats quite fast actually. If you need even more speed, mount a temporary directory for composer caches.

Schrolli91 commented 5 years ago

OK, then Toby should test the build with the commented out prestissimo install, maybe that works then

Schrolli91 commented 5 years ago

I think we can address the problem now... Looks like a problem with the docker version 🤔

timlegge commented 4 years ago

@Schrolli91 what docker version seems to fix this?

Schrolli91 commented 4 years ago

All versions over 19.## should work ... We found version 18.09.7 to be problematic, but we didn't investigate why

we've tested 19.03.2 and 19.03.3 successfully