mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
374 stars 278 forks source link

FatalThrowableError: "Attempted to load class "OAuthRequestListener" on upgrade #203

Open iBobik opened 3 years ago

iBobik commented 3 years ago

I've upgraded Mautic, but it end up on 500 error, probably because caches were not cleared by migrate script - removing cache directory solved issue.

Steps to reproduce

  1. Clean install of 4.0.0-beta - Docker image from PR https://github.com/mautic/docker-mautic/pull/198
  2. Upgrade to 4.0.0-rc (by replacing that stateless image)
  3. Wait for startup and migrations
  4. Error 500

Logs

PHP log:

mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Attempted to load class "OAuthRequestListener" from namespace "Mautic\ApiBundle\EventListener\OAuth1". Did you forget a "use" statement for another namespace?" at /data/cache/prod/ContainerEmEgjKk/appAppKernelProdContainer.php line 2336 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Attempted to load class \"OAuthRequestListener\" from namespace \"Mautic\ApiBundle\EventListener\OAuth1\".\nDid you forget a \"use\" statement for another namespace? at /data/cache/prod/ContainerEmEgjKk/appAppKernelProdContainer.php:2336)"} []

Docker log: Everything normal, including migrates:


========================================================================
Applying any needed database migrations

[2021-07-31 17:07:05]                                                          
[2021-07-31 17:07:05]                     Mautic Migrations                    
[2021-07-31 17:07:05]                                                          

[2021-07-31 17:07:05] Migrating up to 20210609191822 from 20210502162314
[2021-07-31 17:07:05] 
  ++ migrating 20210609191822

[2021-07-31 17:07:06]      -> ALTER TABLE oauth1_access_tokens DROP FOREIGN KEY FK_C33AC86237FDBD6D
[2021-07-31 17:07:06]      -> ALTER TABLE oauth1_request_tokens DROP FOREIGN KEY FK_80F3C6EA37FDBD6D
[2021-07-31 17:07:06]      -> DROP TABLE oauth1_access_tokens
[2021-07-31 17:07:06]      -> DROP TABLE oauth1_consumers
[2021-07-31 17:07:06]      -> DROP TABLE oauth1_nonces
[2021-07-31 17:07:06]      -> DROP TABLE oauth1_request_tokens
[2021-07-31 17:07:06] 
  ++ migrated (took 431.6ms, used 46.5M memory)
[2021-07-31 17:07:06] 
  ------------------------

[2021-07-31 17:07:06]   ++ finished in 434.9ms
[2021-07-31 17:07:06]   ++ used 46.5M memory
[2021-07-31 17:07:06]   ++ 1 migrations executed
[2021-07-31 17:07:06]   ++ 6 sql queries
========================================================================

I would expect it will remove /data/caches automatically when version change was detected.

--- Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/108499078-fatalthrowableerror-attempted-to-load-class-oauthrequestlistener-on-upgrade?utm_campaign=plugin&utm_content=tracker%2F20392502&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F20392502&utm_medium=issues&utm_source=github).
thinkl33t commented 3 years ago

I've pushed a fix to this in #198 - i'd discovered the same issue in my local branch but hadn't pushed it to github.