monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.7k stars 2.18k forks source link

composer install fails on Ubuntu 20.04.4 #6104

Open HammerAdmin86 opened 2 years ago

HammerAdmin86 commented 2 years ago

Standard support for Ubuntu 18.08 will be ending in less than one year. I tried the installation instructions on Ubuntu 20.04.4 but "composer install" fails at Step 3.3 (https://github.com/monicahq/monica/blob/main/docs/installation/providers/ubuntu.md#3-configure-monica). The following package compatibility errors are thrown:

admin1@monica:/var/www/monica$ composer install

App\Helpers\ComposerScripts::preInstall Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1

Running "composer update" then complains that the requirements can't be resolved to an installable set of packages:

admin1@monica:/var/www/monica$ composer update

App\Helpers\ComposerScripts::preUpdate Loading composer repositories with package information Info from https://repo.packagist.org: #StandWithUkraine Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Could the installation guide for Ubuntu 20.04.4 be tested and then docs updated?

HammerAdmin86 commented 2 years ago

running "sudo composer install --no-interaction --no-dev --ignore-platform-reqs" resulting in the following error:

...

In FallbackVersions.php line 114:

Undefined index: name

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

HammerAdmin86 commented 2 years ago

Same issues on Ubuntu 18.04.6.

HammerAdmin86 commented 2 years ago

So, I realized that the install guide is out of date for Ubuntu. The tag mentioned is v2.18.0. Switching to the latest v3.7.0 (as of 2022-May-01) the install proceeds a little further now.

Running "php artisan setup:production --email=user1@example.com --password=password1234 -v" returns:

Monica v3.7.0 is set up, enjoy. ✓ Filling database Seeding: FakeUserTableSeeder

In helpers.php line 284:

[Illuminate\Validation\ValidationException]
The given data was invalid.

Exception trace: at /var/www/monica/vendor/laravel/framework/src/Illuminate/Support/helpers.php:284 throw_if() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Validation/Validator.php:489 Illuminate\Validation\Validator->validate() at /var/www/monica/app/Services/BaseService.php:30 App\Services\BaseService->validate() at /var/www/monica/app/Services/User/CreateUser.php:40 App\Services\User\CreateUser->execute() at /var/www/monica/app/Models/Account/Account.php:664 App\Models\Account\Account::createDefault() at /var/www/monica/database/seeds/FakeUserTableSeeder.php:15 FakeUserTableSeeder->run() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Container\BoundMethod::Illuminate\Container{closure}() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\Util::unwrapIfClosure() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::call() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/Container.php:653 Illuminate\Container\Container->call() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149 Illuminate\Database\Seeder->invoke() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:49 Illuminate\Database\Seeder->call() at /var/www/monica/database/seeds/DatabaseSeeder.php:17 DatabaseSeeder->run() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Container\BoundMethod::Illuminate\Container{closure}() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\Util::unwrapIfClosure() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::call() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/Container.php:653 Illuminate\Container\Container->call() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149 Illuminate\Database\Seeder->invoke() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:66 Illuminate\Database\Console\Seeds\SeedCommand->Illuminate\Database\Console\Seeds{closure}() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:157 Illuminate\Database\Eloquent\Model::unguarded() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:67 Illuminate\Database\Console\Seeds\SeedCommand->handle() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Container\BoundMethod::Illuminate\Container{closure}() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\Util::unwrapIfClosure() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::call() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/Container.php:653 Illuminate\Container\Container->call() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Console/Command.php:136 Illuminate\Console\Command->execute() at /var/www/monica/vendor/symfony/console/Command/Command.php:298 Symfony\Component\Console\Command\Command->run() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Console/Command.php:121 Illuminate\Console\Command->run() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Console/Concerns/CallsCommands.php:68 Illuminate\Console\Command->runCommand() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Console/Concerns/CallsCommands.php:28 Illuminate\Console\Command->call() at /var/www/monica/app/Console/Commands/SetupProduction.php:53 App\Console\Commands\SetupProduction->handle() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Container\BoundMethod::Illuminate\Container{closure}() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\Util::unwrapIfClosure() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::call() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Container/Container.php:653 Illuminate\Container\Container->call() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Console/Command.php:136 Illuminate\Console\Command->execute() at /var/www/monica/vendor/symfony/console/Command/Command.php:298 Symfony\Component\Console\Command\Command->run() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Console/Command.php:121 Illuminate\Console\Command->run() at /var/www/monica/vendor/symfony/console/Application.php:1015 Symfony\Component\Console\Application->doRunCommand() at /var/www/monica/vendor/symfony/console/Application.php:299 Symfony\Component\Console\Application->doRun() at /var/www/monica/vendor/symfony/console/Application.php:171 Symfony\Component\Console\Application->run() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Console/Application.php:94 Illuminate\Console\Application->run() at /var/www/monica/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129 Illuminate\Foundation\Console\Kernel->handle() at /var/www/monica/artisan:37

myuseraccount commented 2 years ago

Got the same problem when installing on Ubuntu 22.04 LTS! Please update the install instructions, or at least give some guidance to look for the current release number when using the git tag command. This still has the old version in both the Ubuntu and generic Linux instructions.

Also, the instructions just stop using sudo at the beginning of the commands, but most will fail because the web root tree is not writable by a normal user, or even the www-data user. I ended up running the git commands as root, then chown-ing the entire tree before continuing, and then adding sudo -u www-data in front of subsequent commands, because composer is very intent on telling you not to run it as root.

aefader00 commented 2 years ago

I am having the same issue. The documentation for creating your own instance desperately need to be updated and rewritten. This is such as cool project but it is so obtuse to set up. It could reach so many more people if it were simpler to set up on your own.