Closed mrysn closed 1 year ago
Can you try copying .env.docker
to .env
before running make?
Thanks for your response, that certainly helped in getting further along. I now have the following problem:
⠿ Container opnform-database-1 Started 5.7s
APPLICATION IN PRODUCTION.
Do you really wish to run this command? (yes/no) [no]
❯ yes
Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = postgres and table_name = migrations and table_type = 'BASE TABLE')
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
756▕ // If an exception occurs when attempting to run a query, we'll format the error
757▕ // message to include the bindings with SQL, which will make this exception a
758▕ // lot more helpful to the developer instead of just the database's errors.
759▕ catch (Exception $e) {
➜ 760▕ throw new QueryException(
761▕ $query, $this->prepareBindings($bindings), $e
762▕ );
763▕ }
764▕ }
+39 vendor frames
40 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
make: *** [.make.migrate] Error 1```
Hi @JhumanJ any thoughts on how this could be resolved? Many thanks
Not sure what happened, but it seems like the migration happens after the database was taken down.. Hence the connection refused error
When I attach to the database container there's the following error looping:
$ docker container attach opnform-database-1
2023-03-10 20:15:08.516 UTC [222] FATAL: role "root" does not exist
2023-03-10 20:15:13.662 UTC [230] FATAL: role "root" does not exist
2023-03-10 20:15:18.783 UTC [238] FATAL: role "root" does not exist
When I CTRL-C I get some PG log output:
^C2023-03-10 20:16:47.278 UTC [1] LOG: received fast shutdown request
2023-03-10 20:16:47.279 UTC [1] LOG: aborting any active transactions
2023-03-10 20:16:47.284 UTC [1] LOG: background worker "logical replication launcher" (PID 31) exited with exit code 1
2023-03-10 20:16:47.286 UTC [26] LOG: shutting down
2023-03-10 20:16:47.289 UTC [26] LOG: checkpoint starting: shutdown immediate
2023-03-10 20:16:47.310 UTC [26] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.001 s, total=0.025 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB
2023-03-10 20:16:47.319 UTC [1] LOG: database system is shut down
Any thoughts on what to try? I have a few ideas I'll try out
Still can't resolve this and I've tried the suggesstions from your link, thanks for that.
I've tried:
PG_USER=postgres
to the .env fileuser: postgres
under database in docker-compose.ymlStill getting connection refused:
And this is the log for the database container:
(Apologies accidentally closed the issue)
I also tried to expose port 5432 on the database container, still getting connection refused. Is there a way to check how the connection attempt is being made?
Also is anybody seeing this problem completely from scratch? I have tried this on Intel and M2 Macs, Ubuntu and CentOS systems getting the same result every time.
I've tried injecting a pg_hba.conf with the following line included
host all all all trust
and still getting connection refused. I think the issue may be happening where the db connection attempts are being made from migrate/artisan/laravel.
Found the cause of the problem! The default MySQL port 3306 is being used when artisan migrate runs. I added this to .env and it seems to have sorted it:
DB_PORT=5432
@JhumanJ I also had to do another fix, in Makefile line 33 removed one hyphen before f
docker compose run --rm php-cli artisan jwt:secret -f
Thanks for reporting your findings. Here's the relevant commit: https://github.com/JhumanJ/OpnForm/commit/37965f33cd39542bdc13ca8ce1d4640d0df007bc I'm marking this as closed, please let us know if something else doesn't work!
Can anybody help or guide me getting past this error?
I am getting the same problem on an Intel iMac and Dell Intel server running CentOS 7.
Steps to recreate:
make up