scriptburn / git-auto-deploy

Deploy your GitHub, GitLab or Bitbucket projects automatically on Git push events or web hooks
312 stars 70 forks source link

Class 'Scriptburn\Settings' not found #9

Closed SebastienReuiller closed 6 years ago

SebastienReuiller commented 6 years ago

Hello,

I try to install git-auto-deploy but I have an error and I don't undestand why. I'm follow the instructions, I try "composer" installation, "git clone" and "wget .zip" and the result is the same : "Class 'Scriptburn\Settings' not found".

I think is a issue.

Thanks for your work and answer.

error.log

scriptburn commented 6 years ago

can you post the output of command composer create-project --no-interaction scriptburn/git-auto-deploy my-app

SebastienReuiller commented 6 years ago

Hello, the output (under Debian 9.2) :

Installing scriptburn/git-auto-deploy (1.0.7)
  - Installing scriptburn/git-auto-deploy (1.0.7): Loading from cache
Created project in my-app
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 24 installs, 0 updates, 0 removals
  - Installing psr/container (1.0.0): Loading from cache
  - Installing container-interop/container-interop (1.2.0): Loading from cache
  - Installing nikic/fast-route (v1.2.0): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing pimple/pimple (v3.2.2): Loading from cache
  - Installing slim/slim (3.8.1): Loading from cache
  - Installing bryanjhv/slim-session (3.3.0): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.6.0): Loading from cache
  - Installing twig/twig (v2.4.4): Loading from cache
  - Installing slim/flash (0.2.0): Loading from cache
  - Installing kanellov/slim-twig-flash (0.2.0): Loading from cache
  - Installing akrabat/rka-ip-address-middleware (0.5): Loading from cache
  - Installing scriptburn/simple-debug (1.0.1): Loading from cache
  - Installing scriptburn/db-settings (1.0.6): Loading from cache
  - Installing scriptburn/db-version-update (1.0.0): Loading from cache
  - Installing slim/twig-view (2.3.0): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing monolog/monolog (1.23.0): Loading from cache
  - Installing slim/pdo (1.10.1): Loading from cache
  - Installing wp-cli/php-cli-tools (v0.10.5): Loading from cache
  - Installing ircmaxell/password-compat (v1.0.4): Loading from cache
  - Installing jeremykendall/password-validator (3.0.4): Loading from cache
  - Installing symfony/process (v3.3.10): Loading from cache
  - Installing phpmailer/phpmailer (v5.2.25): Loading from cache
symfony/polyfill-mbstring suggests installing ext-mbstring (For best performance)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
phpmailer/phpmailer suggests installing league/oauth2-google (Needed for Google XOAUTH2 authentication)
Writing lock file
Generating autoload files

Thanks

sukov commented 6 years ago

Same issue here, any updates on this ?

xpablos commented 6 years ago

Also having the same troubles :-(

scriptburn commented 6 years ago

Can you change line 147 in app/dependencies.php return new \Scriptburn\Settings($c['db']); to return new \ScriptBurn\Setting\Setting($c['db']);

and check, Make sure to also run composer update ?

SebastienReuiller commented 6 years ago

Thanks I do update you recommand and I have a new error :

Slim Application Error

The application could not run because of the following error:
Details
Type: TypeError
Message: Argument 1 passed to ScriptBurn\UpdateDb::__construct() must be an instance of ScriptBurn\Settings, instance of ScriptBurn\Setting\Setting given, called in /var/www/scriptburn_gad/my-app/app/middleware.php on line 5
File: /var/www/scriptburn_gad/my-app/vendor/scriptburn/db-version-update/src/UpdateDb.php
Line: 8
Trace

#0 /var/www/scriptburn_gad/my-app/app/middleware.php(5): ScriptBurn\UpdateDb->__construct(Object(ScriptBurn\Setting\Setting), Object(Slim\PDO\Database), Array)
#1 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#2 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Closure), Array)
#3 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#4 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#5 /var/www/scriptburn_gad/my-app/vendor/bryanjhv/slim-session/src/Slim/Middleware/Session.php(73): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#6 [internal function]: Slim\Middleware\Session->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#7 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Slim\Middleware\Session), Array)
#8 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#9 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#10 /var/www/scriptburn_gad/my-app/app/middleware.php(38): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#11 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#12 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Closure), Array)
#13 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#14 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#15 /var/www/scriptburn_gad/my-app/vendor/akrabat/rka-ip-address-middleware/src/IpAddress.php(93): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#16 [internal function]: RKA\Middleware\IpAddress->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#17 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(RKA\Middleware\IpAddress), Array)
#18 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#19 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#20 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#21 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/App.php(388): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#22 /var/www/scriptburn_gad/my-app/vendor/slim/slim/Slim/App.php(296): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#23 /var/www/scriptburn_gad/my-app/public/index.php(28): Slim\App->run()
#24 {main}

I corrected it by replacing in vendor/scriptburn/db-version-update/src/UpdateDb.php line 8 : public function __construct(\ScriptBurn\Settings $settings, $pdo, $versionData = null) by : public function __construct(\ScriptBurn\Setting\Setting $settings, $pdo, $versionData = null)

It's work! Thanks!

galdazbiz commented 6 years ago

vendor/scriptburn/db-settings/src/Scriptburn/Setting/Setting.php LINE 50 created_at datetime NULL, --> Duplicated in line 51, it has to be deleted

And I still have one more error, not sure where it comes from: Message: SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty File: /app/src/Services/DbUpdateService.php Line: 56

Any idea? Are still more errors?

I've being doing more tests, and I think there are several more errors..

scriptburn commented 6 years ago

Just pushed an update please issue composer update

galdazbiz commented 6 years ago

@scriptburn Thank you, I saw you corrected several issues, although there's some problem with the code I was pointing in the last post:

 $create_table = function ($table)
        {

            $table = is_array($table) ? $table : [$table];
            foreach ($table as $tbl)
            {
                $this->pdo->query($tbl); <-- #### This is line 56 ####

            }
        };
Message: SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty
File: /home/forge/myproject/public_html/burn/app/src/Services/DbUpdateService.php
Line: 56
scriptburn commented 6 years ago

When you get this error?

galdazbiz commented 6 years ago

after composer update.

So I clean the db compose update and I get that

scriptburn commented 6 years ago

Alright found the issue and pushed an update ,Please issue composer update

galdazbiz commented 6 years ago

Yes, thank you so much, it has been solved, and hopefully it's the last thing, now for some reason login returns me error 404 hehe, it's my fault (some config) or the script's?

scriptburn commented 6 years ago

Hmm well that may be something else , why not create a new app with composer create-project --no-interaction scriptburn/git-auto-deploy my-app

galdazbiz commented 6 years ago

you're the best, thank you so much, it works perfect, I think you can close this issue :)