OFFLINE-GmbH / oc-bootstrapper

Easily bootstrap a new October CMS project
MIT License
82 stars 25 forks source link

Class auth does not exist Error on install #54

Open snakemastr opened 3 years ago

snakemastr commented 3 years ago

During install I get the following error for each plugin and later on in october:fresh command

Error running "php artisan plugin:install OFFLINE.Mall" command:
In Container.php line 752:
   Class auth does not exist

Am I missing a plugin or setting? I had a issue with Auth guard when October was updated to Laravel 6, could this be related? This is my october.yaml

app:
    name: october-webshop           # Give this project a unique name
    url: http://webshop.local
    locale: en
    debug: true

cms:
    theme: webshop
    edgeUpdates: false
    disableCoreUpdates: false
    enableSafeMode: false

database:
    connection: mysql
    host: mysql
    port: 3306
    username: root
    password: secret
    database: october

git:
    deployment: false       # Change to "gitlab" for a GitLab CI Setup
    bareRepo: true          # Exclude everything except themes and custom plugins in git
    excludePlugins: false   # Even exclude plugins from your repo. Private plugins will be
                            # checkout out again during each "install" run. Be careful!
                            # Manual changes to these plugins will be overwritten.

# deployment:
#     user: hostinguser
#     server: servername

plugins:
    - Mohsin.OAuth2
    - Octobro.Api
    - OFFLINE.Mall
    - Vdomah.JWTAuth

mail:
    host: smtp.mailgun.org
    name: User Name
    address: email@example.com
    driver: log
snakemastr commented 3 years ago

Plugin dependencies are also not installed, but it should according to the OctoberCMS documentation? In my case Moshin.Oauth2 requires Moshin.Auth but the dependency is not installed. The plugin itself is installed without errors.

I am not sure what to expect. I have check the example and october-tricks example but could not find dependencies being marked as separate plugins.

tobias-kuendig commented 3 years ago

Does it work if you remove all pugisn from the yaml file? Without a stack track, this error could come from everywhere.

You can try and run php artisan plugin:install -v OFFLINE.Mall manually, this should give you some more insights.

snakemastr commented 3 years ago

Thank you for replying. It looks like it really is dependency related. I installed with only OFFLINE.Mall plugin: no errors but also no RainLab dependencies installed. Then I enabled all original plugins and the problem appeared as soon as I added Mohsin.OAuth2. So I add it's only dependency Mohsin.Auth and now I am missing the dependency off Mohsin.Auth which is Mohsin.Rest.

I know installing a plugin with OctoberCMS will try to install plugin dependencies.

Unfortunately I can't get access to the logs and stacktraces. I tried mounting logs and bash while it's installing but to no avail.

Edit: installed without Mohsin and OFFLINE.Mall and got the app working. Then installed OFFLINE.Mall with plugin manager that in turn installed the dependencies. Added Mohsin to the october.yaml; no dependency.

snakemastr commented 3 years ago

I expected artisan plugin:install to install Plugin::$require dependencies but it turns out that's just a feature on the backend installation. The backend uses a callback onInstallPlugins to get all the required plugins and adds them as buildsteps.

Because I saw in this repo the example config with only OFFLINE.Mall without it's RainLab dependencies, I figured either the artisan command or this package would take of that.

Is my conclusion correct? If so, any chance this bootstrapper will be getting a feature like that?

alxy commented 3 years ago

I hink you are right, you need to install the dependencies explicitly. Here is an october.yaml that should work to install October.Mall along with its dependencies.