Forum

composer install Failed - database issue

Posted in CategoryInstallation & Update
  • Mostafa Ahangarha    ( User ) 1 month ago
    Hi

    I just cloned Akaunting from github and ran `composer install` as per instruction said in README file. I got lots of error caused by this issue:

    `Exception: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)`

    As I guessed it is some issue related to mysql, I copied `.env.example` to `.env` and set database to sqlite. I ran the composer install command and received lots of error caused by this issue:
    `Exception: SQLSTATE[HY000]: General error: 1 no such table: users (SQL: select * from "users" where "users"."deleted_at" is null limit 1)`

    Why setting up dependencies is dependent on env config? Isn't it wrong?
  • Leonardo Gomes    ( User ) 1 month ago
    Hi Mostafa.

    I am not sure what is causing the issue, but your database seems empty(no tables).

    Everytime i need to make a fresh install.. i let the own software create its .env file.

    Try to put back the .env file to envexample
    run you composer install, npm install ..
    And at the end run the command
    php artisan install --db-host=localhost... that you also find in the README of the repository.

    This work everytime for me if we keep that sequence, because the migrations will run according to the expectation.


  • Mostafa Ahangarha    ( User ) 1 month ago
    Thanks for your reply.

    I removed .env and ran `composer install`. I again got error like this:

    Exception: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)

    More detailed:
    Trace:
    #0 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(70): PDO->__construct()
    #1 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()
    #2 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
    #3 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
    #4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
    #5 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Database/Connection.php(986): call_user_func()
    #6 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Database/Connection.php(968): Illuminate\Database\Connection->getPdo()
    #7 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Database/Connection.php(948): Illuminate\Database\Connection->getDoctrineConnection()
    #8 /PATH/akaunting/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(422): Illuminate\Database\Connection->getDoctrineSchemaManager()
    #9 /PATH/akaunting/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(272): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->getPropertiesFromTable()
    #10 /PATH/akaunting/vendor/barryvdh/laravel-ide-helper/src/Console/ModelsCommand.php(163): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->generateDocs()
    #11 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->handle()
    #12 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
    #13 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
    #14 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
    #15 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Container/Container.php(614): Illuminate\Container\BoundMethod::call()
    #16 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Container\Container->call()
    #17 /PATH/akaunting/vendor/symfony/console/Command/Command.php(288): Illuminate\Console\Command->execute()
    #18 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()
    #19 /PATH/akaunting/vendor/symfony/console/Application.php(974): Illuminate\Console\Command->run()
    #20 /PATH/akaunting/vendor/symfony/console/Application.php(291): Symfony\Component\Console\Application->doRunCommand()
    #21 /PATH/akaunting/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun()
    #22 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Console/Application.php(92): Symfony\Component\Console\Application->run()
    #23 /PATH/akaunting/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
    #24 /PATH/akaunting/artisan(22): Illuminate\Foundation\Console\Kernel->handle()
    #25 {main}
    Exception: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)
    Could not analyze class App\Models\Sale\Invoice.

    There are several errors like this. that much I cannot scoll up and see all of them.
  • Mostafa Ahangarha    ( User ) 1 month ago
    I dump output to a file and saw these lines that I guess they might help:

    > Illuminate\Foundation\ComposerScripts::postInstall
    > php artisan ide-helper:generate
    A new helper file was written to _ide_helper.php
    > php artisan ide-helper:meta
    A new meta file was written to .phpstorm.meta.php
    > php artisan ide-helper:models --nowrite
    Exception: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)
    Could not analyze class App\Models\Auth\Permission.

Please login or register to leave a response.