subzerocloud / postgrest-starter-kit

Starter Kit and tooling for authoring REST API backends with PostgREST
MIT License
744 stars 71 forks source link

dashboard crashing #22

Closed rjpalermo1 closed 6 years ago

rjpalermo1 commented 6 years ago

Hi,

I tried brand new install - went down the line on install instructions, containers start successfully. cURL example works just as published.

I try to change the sample_data/data.sql file item_1 -> item_1 update and as soon as I save dashboard crashes...

Error: spawn psql ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

I restart the dashboard no problem but run the curl again on /todo and there is no change to item_1.

I press r on the running dashboard terminal and get same crash as above.

MAC/OSX using node v8.9.1

rjpalermo1 commented 6 years ago

FYI I removed and reinstalled several times same effect.

ruslantalpa commented 6 years ago

thanks for the report, i will investigate tomorrow (i think i've seen this error).

ruslantalpa commented 6 years ago

did you do a docker pull subzerocloud/subzero-cli-tools?

ruslantalpa commented 6 years ago

it's not that, it's and oversight, i forgot to use the psql client from the docker image. To fix this for now, install psql on your system. probably brew install postgresql then it should work. I'll remove this dependency tomorrow

rjpalermo1 commented 6 years ago

Ok - adding psql worked - no longer crashes.

Now on saving updated .sql file getting:

Watching db/src/**/*.sql, openresty/lualib/**/*.lua, openresty/nginx/conf/**/*.conf for changes.                                                    │
│in /Users/me/subzero/example-api                                                                                                              │
│./db/src/sample_data/data.sql changed                                                                                                               │
│Starting code reload ------------------------                                                                                                       │
│psql: FATAL:  role "superuser" does not exist                                                                                                       │
│                                                                                                                                                    │
│Ready ---------------------------------------                                                                                                       │
│psql: FATAL:  role "superuser" does not exist   

Probably something I should know if I was a postgres guy, but I'm not.

Thanks!

ruslantalpa commented 6 years ago

try and do a docker-compose down && docker-compose up -d that error might be a result of the crashes

rjpalermo1 commented 6 years ago

:( same error. also tried a and r with same results.

ruslantalpa commented 6 years ago

forgot you just installed postgresql :) do this

brew services stop postgresql
docker-compose down && docker-compose up -d

(check after this to make sure postgresql does not start on the next reboot, see brew documentation)

rjpalermo1 commented 6 years ago

Got it! Thank you - off to the tut! Will check for update tomorrow or later....

ruslantalpa commented 6 years ago

there have been some updates since then, except for the problems when you have PG running on the host, the other issues should be gone