docs icon indicating copy to clipboard operation
docs copied to clipboard

Document REDIS_PATH

Open Showfom opened this issue 2 years ago • 5 comments
trafficstars

Hello,

I just try to install a new pixelfed today but failed when I run php artisan migrate --force

Database version

root@pixelfed ~ # mysql --version
mysql  Ver 15.1 Distrib 10.6.11-MariaDB, for debian-linux-gnu (x86_64) using readline EditLine wrapper

Firstly, I try to use 127.0.0.1 as the DB_HOST but failed:


   Illuminate\Database\QueryException 

  SQLSTATE[HY000] [1045] Access denied for user 'pixelfed_user2'@'127.0.0.1' (using password: YES) (SQL: select * from information_schema.tables where table_schema = pixelfed_database2 and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
    708▕         // If an exception occurs when attempting to run a query, we'll format the error
    709▕         // message to include the bindings with SQL, which will make this exception a
    710▕         // lot more helpful to the developer instead of just the database's errors.
    711▕         catch (Exception $e) {
  ➜ 712▕             throw new QueryException(
    713▕                 $query, $this->prepareBindings($bindings), $e
    714▕             );
    715▕         }
    716▕     }

      +36 vendor frames

Then I switch to DB_SOCKET

   InvalidArgumentException 

  Missing UNIX domain socket path.

  at vendor/predis/predis/src/Connection/StreamConnection.php:193
    189▕      */
    190▕     protected function unixStreamInitializer(ParametersInterface $parameters)
    191▕     {
    192▕         if (!isset($parameters->path)) {
  ➜ 193▕             throw new \InvalidArgumentException('Missing UNIX domain socket path.');
    194▕         }
    195▕ 
    196▕         $flags = STREAM_CLIENT_CONNECT;
    197▕ 

      +21 vendor frames 
  22  database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php:44
      App\Jobs\InstancePipeline\InstanceCrawlPipeline::dispatch()

  23  database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php:24
      AddSoftwareColumnToInstancesTable::runPostMigration()

When I try to run the second time:

Migrating: 2021_08_30_050137_add_software_column_to_instances_table

   Illuminate\Database\QueryException 

  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'software' (SQL: alter table `instances` add `software` varchar(191) null, add `user_count` int unsigned null, add `status_count` int unsigned null, add `last_crawled_at` timestamp null)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
    708▕         // If an exception occurs when attempting to run a query, we'll format the error
    709▕         // message to include the bindings with SQL, which will make this exception a
    710▕         // lot more helpful to the developer instead of just the database's errors.
    711▕         catch (Exception $e) {
  ➜ 712▕             throw new QueryException(
    713▕                 $query, $this->prepareBindings($bindings), $e
    714▕             );
    715▕         }
    716▕     }

      +12 vendor frames 
  13  database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php:22
      Illuminate\Support\Facades\Facade::__callStatic()

      +22 vendor frames 
  36  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Showfom avatar Dec 28 '22 09:12 Showfom

@Showfom since you have a new install, have you tried php artisan db:wipe and starting the install from the beginning?

okpierre avatar Dec 28 '22 10:12 okpierre

@Showfom since you have a new install, have you tried php artisan db:wipe and starting the install from the beginning?

I tried, also I drop the whole database and created a new one, that's why the db name is pixelfed_database2

Still this error:

Migrated:  2021_08_23_062246_update_stories_table_fix_expires_at_column (213.99ms)
Migrating: 2021_08_30_050137_add_software_column_to_instances_table

   InvalidArgumentException 

  Missing UNIX domain socket path.

  at vendor/predis/predis/src/Connection/StreamConnection.php:193
    189▕      */
    190▕     protected function unixStreamInitializer(ParametersInterface $parameters)
    191▕     {
    192▕         if (!isset($parameters->path)) {
  ➜ 193▕             throw new \InvalidArgumentException('Missing UNIX domain socket path.');
    194▕         }
    195▕ 
    196▕         $flags = STREAM_CLIENT_CONNECT;
    197▕ 

      +21 vendor frames 
  22  database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php:44
      App\Jobs\InstancePipeline\InstanceCrawlPipeline::dispatch()

  23  database/migrations/2021_08_30_050137_add_software_column_to_instances_table.php:24
      AddSoftwareColumnToInstancesTable::runPostMigration()

I also tried the unreleased version from Github and the v0.11.4 version from https://github.com/pixelfed/pixelfed/releases/tag/v0.11.4

Both failed :(

Showfom avatar Dec 28 '22 10:12 Showfom

Problem solved after changing redis back to tcp instead of unix

Showfom avatar Dec 28 '22 11:12 Showfom

Looks like the installation instructions are out of date, you need REDIS_PATH instead of REDIS_HOST for a unix socket.

factorsofx avatar Feb 12 '23 00:02 factorsofx

stumbled on this today, it's unfortunate that the error message doesn't make it clear that this is an issue with redis setup rather than postgresql.

melissaboiko avatar May 27 '23 14:05 melissaboiko