Comments (12)
I tried ENV COMPOSER_ALLOW_SUPERUSER=1
in my DockerFile and it works like a charm.
Composer documentation :
COMPOSER_ALLOW_SUPERUSER#
If set to 1, this env disables the warning about running commands as root/super user. It also disables automatic clearing of sudo sessions, so you should really only set this if you use Composer as a super user at all times like in docker containers.
from api-platform.
Probably explained by this composer issue.
from api-platform.
Same issue encountered on project using api-platform v3.1 and symfony v6.3
It seems like the command composer install --no-progress --no-scripts --optimize-autoloader --prefer-dist --no-interaction
executed, when building the production image, don't generate the file autoload_runtime.php required by the console.
composer require symfony/runtime
generate the file.
From the symfony documentation :
If you use the Composer --no-plugins option, the autoload_runtime.php file won't be created.
If you use the Composer --no-scripts option, make sure your Composer version is >=2.1.3; otherwise the autoload_runtime.php file won't be created.
Here is the log of our gitlab CI :
#35 [stage-1 24/25] RUN composer install --no-progress --no-scripts --optimize-autoloader --prefer-dist --no-interaction
#35 0.320 Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
Maybe it is the root cause of this issue.
from api-platform.
@Bryce-Colton I have set ENV COMPOSER_ALLOW_SUPERUSER=1 in my DockerFile but i am still facing the issue.
from api-platform.
docker compose build --no-cache --pull
from api-platform.
Had the same error today, even after trying docker compose build --no-cache --build
from api-platform.
Has anyone found a solution to make it work?
from api-platform.
@RobertoGarc1a not sure it works or not, try to delete all the images and containers and run the commands mentioned in api platform docs. when the containers are up go to docker desktop and open api container wait until the logs of api container successfully installs all the package after try to open the localhost url. This has worked for me.
from api-platform.
Otherwise, try running composer install
in the container.
from api-platform.
Adding ENV COMPOSER_ALLOW_SUPERUSER=1
work but is it recommended way now?
from api-platform.
Yes? But this env var should be there by default in the container.
from api-platform.
I just met the same issue on FrankenPHP, it's related to the vendor volume, somehow the composer install in the entrypoint didn't proc
I "fixed" it by simply enabling this https://github.com/api-platform/api-platform/blob/main/compose.override.yaml#L14
from api-platform.
Related Issues (20)
- denormalizationContext imbrique
- New Format : RSS feed
- Open up Paginator::$documents for read
- 502 status code in "Check PWA reachability" ci step
- Specific order of operations in #ApiResource annotation causes incorrect API schema (using wrong serialization group)
- Impossible to use vite/vue3 with supplied Caddyfile HOT 3
- The event_listeners_backward_compatibility_layer: true is broken in version 3.3.0 HOT 1
- Building 3.3.2 for production throws: Error: <Html> should not be imported outside of pages/_document. HOT 3
- "Invalid identifier value or configuration." HOT 1
- ProcessorInterface multiple ProcessorInterfaces (persist & remove) && Security within State Providers
- Asset mapper warnings HOT 1
- Potential conflict between API Platform and Gedmo\Translatable
- Strange Api-platform activity. It looks like ApiProperty Attribute doesn't work with json format. Looks like a security issue. HOT 5
- Support indexes in query collection/array parameters
- Handling File Upload Error
- Why i am not able to deploy second time like first time i can in second i see this error
- Why i am not able to deploy second time like first time i can in second i see this error
- How to handle Custom Filter Queries in Symfony - compatible with api platform HOT 1
- Custom messenger bus & custom dto cannot be used at the same site
- Filters incompatible with PHP 8.2.20 and 8.3.8 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-platform.