Page MenuHomePhabricator

Installation instructions don't work because they are incomplete
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

I am following these installation instructions: https://github.com/wikimedia/ws-export

I ran the command:

composer install --no-dev

And this was the output:

@php ./bin/console cache:clear
Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#58

#message: """
  Attempted to load class "WebProfilerBundle" from namespace "Symfony\Bundle\WebProfilerBundle".\n
  Did you forget a "use" statement for another namespace?
  """

So far it seems to be saying that the class "WebProfilerBundle" was not found, not necessarily that the namespace "Symfony" was not present, or that could be the issue.

#code: 0
#file: "./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php"
#line: 132
trace: {
  ./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php:132 { …}
  ./vendor/symfony/http-kernel/Kernel.php:386 { …}
  ./vendor/symfony/http-kernel/Kernel.php:786 { …}
  ./vendor/symfony/http-kernel/Kernel.php:128 { …}
  ./vendor/symfony/framework-bundle/Console/Application.php:168 { …}
  ./vendor/symfony/framework-bundle/Console/Application.php:74 { …}
  ./vendor/symfony/console/Application.php:171 { …}
  ./bin/console:47 {
    › }
    › $application->run($input);
    › 
  }
}

}
2022-09-22T10:06:01+00:00 [critical] Uncaught Error: Class 'Symfony\Bundle\WebProfilerBundle\WebProfilerBundle' not found
Script @php ./bin/console cache:clear handling the post-install-cmd event returned with error code

Someone on Reddit said: "the symfony/web-profiler-bundle is not installed via composer but it's referenced in config/bundles.php".

Is this issue simply that the GitHub instructions are wrong - you should not run "composer install" with "--no-dev", because you need Symfony to also be installed?

What happens?:

The error message above

What should have happened instead?:

It should have successfully installed the dependencies.

Software version (skip for WMF-hosted wikis like Wikipedia):

PHP 7.4 on Ubuntu 22

Other information (browser name/version, screenshots, etc.):

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Thanks for reporting this!

I think the issue here is that APP_ENV defaults to dev, but when Composer dependencies are installed without dev dependencies that doesn't work. Instead, it should default to APP_ENV=prod in .env, and developers can override this in their .env.local if need be.

Does it work if you change APP_ENV?

The default APP_ENV has been updated: https://github.com/wikimedia/ws-export/pull/431

Can you pull the latest code and see how it works for you?

Thanks!

KSiebert renamed this task from Installation instructions don't work because to Installation instructions don't work because they are incomplete.Oct 12 2022, 11:06 AM
Samwilson claimed this task.
Samwilson set the point value for this task to 1.
JMcLeod_WMF closed this task as Resolved.
JMcLeod_WMF removed Samwilson as the assignee of this task.