hashicorp-demoapp / product-api-go

Products API written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fresh install doesn't work

condaatje opened this issue · comments

maybe I'm doing something dumb, but I'm unable to get the api server running from a fresh clone/build of this repo. Any help would be greatly appreciated.

steps to reproduce:

$ git clone <repo> && cd <repo>
$ shipyard run blueprint

Running configuration from:  ./blueprint

2021-02-15T11:00:52.520-0800 [INFO]  Creating Network: ref=local
2021-02-15T11:00:52.566-0800 [INFO]  Creating Container: ref=db
2021-02-15T11:00:52.566-0800 [INFO]  Creating Container: ref=api
2021-02-15T11:00:52.963-0800 [INFO]  Creating Ingress: ref=db
2021-02-15T11:00:53.011-0800 [INFO]  Creating Ingress: ref=api

########################################################

Title Product API
Author Erik Veld, Nicholas Jackson

┃ To connect to the PostgreSQL DB use localhost:15432
┃
┃ The API can be accessed at http://localhost:19090/coffees

$ curl -v localhost:19090/coffees

*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 19090 (#0)
> GET /coffees HTTP/1.1
> Host: localhost:19090
> User-Agent: curl/7.64.1
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
$ docker logs db.container.shipyard.run

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... Etc/UTC
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2021-02-15 19:04:24.073 UTC [48] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-02-15 19:04:24.082 UTC [49] LOG:  database system was shut down at 2021-02-15 19:04:23 UTC
2021-02-15 19:04:24.086 UTC [48] LOG:  database system is ready to accept connections
 done
server started
CREATE DATABASE


/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/products.sql
CREATE TABLE
CREATE TABLE
CREATE TABLE
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1


waiting for server to shut down....2021-02-15 19:04:24.551 UTC [48] LOG:  received fast shutdown request
2021-02-15 19:04:24.552 UTC [48] LOG:  aborting any active transactions
2021-02-15 19:04:24.554 UTC [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
2021-02-15 19:04:24.555 UTC [50] LOG:  shutting down
2021-02-15 19:04:24.574 UTC [48] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2021-02-15 19:04:24.664 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-02-15 19:04:24.664 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2021-02-15 19:04:24.667 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-02-15 19:04:24.676 UTC [75] LOG:  database system was shut down at 2021-02-15 19:04:24 UTC
2021-02-15 19:04:24.680 UTC [1] LOG:  database system is ready to accept connections

$ docker logs api.container.shipyard.run

2021-02-15T19:04:23.335Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"
2021-02-15T19:04:24.339Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"
2021-02-15T19:04:25.348Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"
2021-02-15T19:04:26.321Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"
2021-02-15T19:04:27.332Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"
2021-02-15T19:04:28.338Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"
2021-02-15T19:04:29.345Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"
2021-02-15T19:04:30.351Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"
2021-02-15T19:04:36.360Z [ERROR] Unable to connect to database: error="dial tcp: lookup db.container.shipyard on 127.0.0.11:53: no such host"