GithubHelp home page GithubHelp logo

Comments (12)

koistya avatar koistya commented on May 1, 2024

@MikePugs try setting CHOKIDAR_USEPOLLING environment variable in your docker-compose.override.yml to true (or 1)

from relay-starter-kit.

MikePugs avatar MikePugs commented on May 1, 2024

No luck.

My Steps:

  1. Created the following docker-compose.override.yml:
version: '3'

services:
  api:
    environment:
      - CHOKIDAR_USEPOLLING=true 
  1. Removed all existing containers

  2. Ran docker-compose up

$ docker-compose up
Creating exampleapi_redis_1 ...
Creating exampleapi_db_1 ...
Creating exampleapi_redis_1
Creating exampleapi_redis_1 ... done
Creating exampleapi_api_1 ...
Creating exampleapi_api_1 ... done
Creating exampleapi_nginx_1 ...
Creating exampleapi_nginx_1 ... done
Attaching to exampleapi_db_1, exampleapi_redis_1, exampleapi_api_1, exampleapi_nginx_1
db_1 | LOG: database system was interrupted; last known up at 2017-08-16 17:51:18 UTC
db_1 | LOG: database system was not properly shut down; automatic recovery in progress
redis_1 | 1:C 16 Aug 17:54:48.982 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
db_1 | LOG: invalid record length at 0/14EE0A8: wanted 24, got 0
redis_1 | 1:C 16 Aug 17:54:48.982 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
db_1 | LOG: redo is not required
redis_1 | 1:C 16 Aug 17:54:48.982 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
db_1 | LOG: MultiXact member wraparound protections are now enabled
redis_1 | 1:M 16 Aug 17:54:48.983 * Running mode=standalone, port=6379.
db_1 | LOG: database system is ready to accept connections
redis_1 | 1:M 16 Aug 17:54:48.983 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
db_1 | LOG: autovacuum launcher started
redis_1 | 1:M 16 Aug 17:54:48.983 # Server initialized
redis_1 | 1:M 16 Aug 17:54:48.983 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis_1 | 1:M 16 Aug 17:54:48.983 * DB loaded from disk: 0.000 seconds
redis_1 | 1:M 16 Aug 17:54:48.984 * Ready to accept connections
api_1 | Starting 'run'...
api_1 | Starting 'db-migrate'...
db_1 | FATAL: database "dev" does not exist
db_1 | FATAL: database "dev" does not exist
db_1 | FATAL: database "dev" does not exist
api_1 | error: database "dev" does not exist
api_1 | at Connection.parseE (/usr/src/app/node_modules/pg/lib/connection.js:546:11)
api_1 | at Connection.parseMessage (/usr/src/app/node_modules/pg/lib/connection.js:371:19)
api_1 | at Socket. (/usr/src/app/node_modules/pg/lib/connection.js:114:22)
api_1 | at emitOne (events.js:115:13)
api_1 | at Socket.emit (events.js:210:7)
api_1 | at addChunk (_stream_readable.js:252:12)
api_1 | at readableAddChunk (_stream_readable.js:239:11)
api_1 | at Socket.Readable.push (_stream_readable.js:197:10)
api_1 | at TCP.onread (net.js:589:20)
api_1 | Starting 'build'...
api_1 | src/DataLoaders.js -> build/DataLoaders.js
api_1 | src/app.js -> build/app.js
api_1 | src/db.js -> build/db.js
api_1 | src/email.js -> build/email.js
api_1 | src/passport.js -> build/passport.js
api_1 | src/redis.js -> build/redis.js
api_1 | src/server.js -> build/server.js
api_1 | src/routes/account.js -> build/routes/account.js
api_1 | src/schema/Comment.js -> build/schema/Comment.js
api_1 | src/schema/CommentType.js -> build/schema/CommentType.js
api_1 | src/schema/EmailType.js -> build/schema/EmailType.js
api_1 | src/schema/Node.js -> build/schema/Node.js
api_1 | src/schema/README.md -> build/schema/README.md
api_1 | src/schema/Story.js -> build/schema/Story.js
api_1 | src/schema/StoryType.js -> build/schema/StoryType.js
api_1 | src/schema/User.js -> build/schema/User.js
api_1 | src/schema/UserType.js -> build/schema/UserType.js
api_1 | src/schema/ValidationError.js -> build/schema/ValidationError.js
api_1 | src/schema/index.js -> build/schema/index.js
api_1 | src/emails/welcome/html.hbs -> build/emails/welcome/html.js
api_1 | src/emails/welcome/subject.hbs -> build/emails/welcome/subject.js
api_1 | Finished 'build' after 1012ms
api_1 | Node.js API server is listening on http://api:8080/
db_1 | FATAL: database "dev" does not exist
db_1 | FATAL: database "dev" does not exist

from relay-starter-kit.

koistya avatar koistya commented on May 1, 2024

I see "Node.js API server is listening on ..." it means that the app is running, you should be able to access it via http://localhost:8080/.. Regarding "database dev does not exist", one way is to remove the volumes created during the initial run of docker-compose up and try again, you can use docker volume ls, docker volume rm .. commands to manipulate volumes.. regarding the env variables, you can check what variables are set inside a container by running docker-compose run --rm --no-deps api printenv

from relay-starter-kit.

koistya avatar koistya commented on May 1, 2024

@MikePugs this script is executed during the initial run of docker-compose up when no volumes exist yet => https://github.com/kriasoft/nodejs-api-starter/blob/master/config/postgres-initdb.sh After volumes are created they are staying permanently on your machine and this script is ignored, but you can remove volumes manually if needed (see my comment above).

from relay-starter-kit.

MikePugs avatar MikePugs commented on May 1, 2024

Here are the environment variables returned by the command you provided:

$ docker-compose run --rm --no-deps api printenv
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=api
TWITTER_SECRET=xxxxx
DATABASE_DEBUG=false
GOOGLE_ID=xxxxx.apps.googleusercontent.com
CORS_ORIGIN=http://localhost:3001,http://localhost:3000
FACEBOOK_SECRET=2339bdf25f236a42fc3a18280bf455e8
GOOGLE_SECRET=xxxxx
REDIS_URL=redis://redis:6379/0
DATABASE_URL=postgres://postgres@db:5432/dev
CHOKIDAR_USEPOLLING=true
TWITTER_KEY=xxxxx
FACEBOOK_ID=1821424564802638
SESSION_SECRET=wZjwhFtzQsd7r87W6AZw45Sm
NPM_CONFIG_LOGLEVEL=info
NODE_VERSION=8.3.0
YARN_VERSION=0.27.5
HOME=/home/node

It seems that I am only able to remove a volume after I remove the associated container. Otherwise, I receive the following error:

$ docker volume rm exampleapi_db
Error response from daemon: unable to remove volume: remove exampleapi_db: volume is in use - [83bd33a561f45347e6fb827914ae930e0f6177b5d8b31f37b8e2de4378c04249]

After I remove all of the containers and all of the volumes I still receive docker-compose up errors

No Containers:

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

No Volumes:

$ docker volume ls
DRIVER              VOLUME NAME

docker-compose up

$ docker-compose up
Creating volume "exampleapi_redis" with default driver
Creating volume "exampleapi_db" with default driver
Creating volume "exampleapi_yarn" with default driver
Creating exampleapi_redis_1 ...
Creating exampleapi_db_1 ...
Creating exampleapi_redis_1
Creating exampleapi_redis_1 ... done
Creating exampleapi_api_1 ...
Creating exampleapi_api_1 ... done
Creating exampleapi_nginx_1 ...
Creating exampleapi_nginx_1 ... done
Attaching to exampleapi_db_1, exampleapi_redis_1, exampleapi_api_1, exampleapi_nginx_1
db_1     | The files belonging to this database system will be owned by user "postgres".
db_1     | This user must also own the server process.
db_1     |
redis_1  | 1:C 16 Aug 19:21:48.294 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
db_1     | The database cluster will be initialized with locale "en_US.utf8".
redis_1  | 1:C 16 Aug 19:21:48.294 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
db_1     | The default database encoding has accordingly been set to "UTF8".
redis_1  | 1:C 16 Aug 19:21:48.294 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
db_1     | The default text search configuration will be set to "english".
redis_1  | 1:M 16 Aug 19:21:48.294 * Running mode=standalone, port=6379.
db_1     |
redis_1  | 1:M 16 Aug 19:21:48.294 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
db_1     | Data page checksums are disabled.
redis_1  | 1:M 16 Aug 19:21:48.294 # Server initialized
db_1     |
redis_1  | 1:M 16 Aug 19:21:48.295 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis_1  | 1:M 16 Aug 19:21:48.295 * Ready to accept connections
db_1     | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1     | creating subdirectories ... ok
db_1     | selecting default max_connections ... 100
db_1     | selecting default shared_buffers ... 128MB
db_1     | selecting dynamic shared memory implementation ... posix
db_1     | creating configuration files ... ok
db_1     | running bootstrap script ... ok
db_1     | performing post-bootstrap initialization ... No usable system locales were found.
db_1     | Use the option "--debug" to see details.
db_1     | sh: locale: not found
db_1     | ok
db_1     | syncing data to disk ... ok
db_1     |
db_1     | Success. You can now start the database server using:
db_1     |
db_1     |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1     |
db_1     |
db_1     | WARNING: enabling "trust" authentication for local connections
db_1     | You can change this by editing pg_hba.conf or using the option -A, or
db_1     | --auth-local and --auth-host, the next time you run initdb.
db_1     | ****************************************************
db_1     | WARNING: No password has been set for the database.
db_1     |          This will allow anyone with access to the
db_1     |          Postgres port to access your database. In
db_1     |          Docker's default configuration, this is
db_1     |          effectively any other container on the same
db_1     |          system.
db_1     |
db_1     |          Use "-e POSTGRES_PASSWORD=password" to set
db_1     |          it in "docker run".
db_1     | ****************************************************
db_1     | waiting for server to start....LOG:  could not bind IPv6 socket: Address not available
db_1     | HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
db_1     | LOG:  database system was shut down at 2017-08-16 19:21:49 UTC
db_1     | LOG:  MultiXact member wraparound protections are now enabled
db_1     | LOG:  database system is ready to accept connections
db_1     | LOG:  autovacuum launcher started
db_1     |  done
db_1     | server started
db_1     | ALTER ROLE
db_1     |
db_1     |
db_1     | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/initdb.sh
db_1     | /docker-entrypoint-initdb.d/initdb.sh: line 2: $'\r': command not found
exampleapi_db_1 exited with code 127
api_1    | Starting 'run'...
api_1    | Starting 'db-migrate'...
api_1    | Error: getaddrinfo EAI_AGAIN db:5432
api_1    |     at Object._errnoException (util.js:1022:11)
api_1    |     at errnoException (dns.js:58:15)
api_1    |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:95:26)
api_1    | Starting 'build'...
api_1    | src/DataLoaders.js -> build/DataLoaders.js
api_1    | src/app.js -> build/app.js
api_1    | src/db.js -> build/db.js
api_1    | src/email.js -> build/email.js
api_1    | src/passport.js -> build/passport.js
api_1    | src/redis.js -> build/redis.js
api_1    | src/server.js -> build/server.js
api_1    | src/routes/account.js -> build/routes/account.js
api_1    | src/schema/Comment.js -> build/schema/Comment.js
api_1    | src/schema/CommentType.js -> build/schema/CommentType.js
api_1    | src/schema/EmailType.js -> build/schema/EmailType.js
api_1    | src/schema/Node.js -> build/schema/Node.js
api_1    | src/schema/README.md -> build/schema/README.md
api_1    | src/schema/Story.js -> build/schema/Story.js
api_1    | src/schema/StoryType.js -> build/schema/StoryType.js
api_1    | src/schema/User.js -> build/schema/User.js
api_1    | src/schema/UserType.js -> build/schema/UserType.js
api_1    | src/schema/ValidationError.js -> build/schema/ValidationError.js
api_1    | src/schema/index.js -> build/schema/index.js
api_1    | src/emails/welcome/html.hbs -> build/emails/welcome/html.js
api_1    | src/emails/welcome/subject.hbs -> build/emails/welcome/subject.js
api_1    | Finished 'build' after 1689ms
api_1    | Node.js API server is listening on http://api:8080/

from relay-starter-kit.

koistya avatar koistya commented on May 1, 2024

I see, it complains about the \r symbol in the config/postgres-initdb.sh file. I just added .sh extension to .gitattributes in a8f4663. Try merging this update into your project, removing db volume and running docker-compose up again.

git remote add nodejs-api-starter https://github.com/kriasoft/nodejs-api-starter.git
git checkout master
git fetch nodejs-api-starter
git merge nodejs-api-starter/master

from relay-starter-kit.

MikePugs avatar MikePugs commented on May 1, 2024

I'm not sure I did the git update correctly, or if I continued to experience issues because it wasn't just the last \r that caused the error.

I solved that particular \r error by running the following:

sed -i 's/\r//' config/postgres-initdb.sh

which I believe replaces all of the \r characters in the file*.

After I ran that command, removed all containers and volumes the \r error went away. Note the line that says LOG: received fast shutdown request though...

$ docker-compose up
Creating volume "exampleapi_redis" with default driver
Creating volume "exampleapi_db" with default driver
Creating volume "exampleapi_yarn" with default driver
Creating exampleapi_redis_1 ...
Creating exampleapi_db_1 ...
Creating exampleapi_redis_1
Creating exampleapi_db_1 ... done
Creating exampleapi_api_1 ...
Creating exampleapi_api_1 ... done
Creating exampleapi_nginx_1 ...
Creating exampleapi_nginx_1 ... done
Attaching to exampleapi_redis_1, exampleapi_db_1, exampleapi_api_1, exampleapi_nginx_1
redis_1  | 1:C 16 Aug 20:28:51.372 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1  | 1:C 16 Aug 20:28:51.372 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1  | 1:C 16 Aug 20:28:51.372 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
db_1     | The files belonging to this database system will be owned by user "postgres".
redis_1  | 1:M 16 Aug 20:28:51.373 * Running mode=standalone, port=6379.
db_1     | This user must also own the server process.
redis_1  | 1:M 16 Aug 20:28:51.373 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
db_1     |
redis_1  | 1:M 16 Aug 20:28:51.373 # Server initialized
db_1     | The database cluster will be initialized with locale "en_US.utf8".
redis_1  | 1:M 16 Aug 20:28:51.373 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
db_1     | The default database encoding has accordingly been set to "UTF8".
redis_1  | 1:M 16 Aug 20:28:51.373 * Ready to accept connections
db_1     | The default text search configuration will be set to "english".
db_1     |
db_1     | Data page checksums are disabled.
db_1     |
db_1     | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1     | creating subdirectories ... ok
db_1     | selecting default max_connections ... 100
db_1     | selecting default shared_buffers ... 128MB
db_1     | selecting dynamic shared memory implementation ... posix
db_1     | creating configuration files ... ok
db_1     | running bootstrap script ... ok
db_1     | performing post-bootstrap initialization ... sh: locale: not found
db_1     | No usable system locales were found.
db_1     | Use the option "--debug" to see details.
db_1     | ok
db_1     | syncing data to disk ...
db_1     | WARNING: enabling "trust" authentication for local connections
db_1     | You can change this by editing pg_hba.conf or using the option -A, or
db_1     | --auth-local and --auth-host, the next time you run initdb.
db_1     | ok
db_1     |
db_1     | Success. You can now start the database server using:
db_1     |
db_1     |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1     |
db_1     | ****************************************************
db_1     | WARNING: No password has been set for the database.
db_1     |          This will allow anyone with access to the
db_1     |          Postgres port to access your database. In
db_1     |          Docker's default configuration, this is
db_1     |          effectively any other container on the same
db_1     |          system.
db_1     |
db_1     |          Use "-e POSTGRES_PASSWORD=password" to set
db_1     |          it in "docker run".
db_1     | ****************************************************
db_1     | waiting for server to start....LOG:  could not bind IPv6 socket: Address not available
db_1     | HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
db_1     | LOG:  database system was shut down at 2017-08-16 20:28:52 UTC
db_1     | LOG:  MultiXact member wraparound protections are now enabled
db_1     | LOG:  database system is ready to accept connections
db_1     | LOG:  autovacuum launcher started
db_1     |  done
db_1     | server started
db_1     | ALTER ROLE
db_1     |
db_1     |
db_1     | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/initdb.sh
api_1    | Starting 'run'...
db_1     | CREATE DATABASE
db_1     | CREATE EXTENSION
db_1     | CREATE EXTENSION
db_1     |
db_1     | LOG:  received fast shutdown request
db_1     | LOG:  aborting any active transactions
db_1     | LOG:  autovacuum launcher shutting down
db_1     | waiting for server to shut down....LOG:  shutting down
db_1     | LOG:  database system is shut down
api_1    | Starting 'db-migrate'...
api_1    | Error: connect ECONNREFUSED 172.18.0.3:5432
api_1    |     at Object._errnoException (util.js:1022:11)
api_1    |     at _exceptionWithHostPort (util.js:1045:20)
api_1    |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14)
api_1    | Starting 'build'...
db_1     |  done
db_1     | server stopped
db_1     |
db_1     | PostgreSQL init process complete; ready for start up.
db_1     |
api_1    | src/DataLoaders.js -> build/DataLoaders.js
api_1    | src/db.js -> build/db.js
api_1    | src/app.js -> build/app.js
api_1    | src/email.js -> build/email.js
db_1     | LOG:  database system was shut down at 2017-08-16 20:28:57 UTC
db_1     | LOG:  MultiXact member wraparound protections are now enabled
db_1     | LOG:  database system is ready to accept connections
db_1     | LOG:  autovacuum launcher started
api_1    | src/passport.js -> build/passport.js
api_1    | src/redis.js -> build/redis.js
api_1    | src/server.js -> build/server.js
api_1    | src/routes/account.js -> build/routes/account.js
api_1    | src/schema/Comment.js -> build/schema/Comment.js
api_1    | src/schema/CommentType.js -> build/schema/CommentType.js
api_1    | src/schema/EmailType.js -> build/schema/EmailType.js
api_1    | src/schema/Node.js -> build/schema/Node.js
api_1    | src/schema/README.md -> build/schema/README.md
api_1    | src/schema/Story.js -> build/schema/Story.js
api_1    | src/schema/StoryType.js -> build/schema/StoryType.js
api_1    | src/schema/User.js -> build/schema/User.js
api_1    | src/schema/UserType.js -> build/schema/UserType.js
api_1    | src/schema/ValidationError.js -> build/schema/ValidationError.js
api_1    | src/schema/index.js -> build/schema/index.js
api_1    | src/emails/welcome/html.hbs -> build/emails/welcome/html.js
api_1    | src/emails/welcome/subject.hbs -> build/emails/welcome/subject.js
api_1    | Finished 'build' after 1172ms
api_1    | Node.js API server is listening on http://api:8080/

The next step of seeding the database understandably throws errors as a result:

winpty docker-compose exec api yarn db-seed

yarn db-seed v0.27.5
$ node tools/db.js seed
Starting 'db-seed'...
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
db_1     | ERROR:  relation "users" does not exist at character 13
db_1     | STATEMENT:  insert into "users" ("display_name", "emails", "image_url") values ($1, $2, $3) returning "id"
error: relation "users" does not exist
    at Connection.parseE (/usr/src/app/node_modules/pg/lib/connection.js:546:11)
    at Connection.parseMessage (/usr/src/app/node_modules/pg/lib/connection.js:371:19)
    at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:114:22)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at addChunk (_stream_readable.js:252:12)
    at readableAddChunk (_stream_readable.js:239:11)
    at Socket.Readable.push (_stream_readable.js:197:10)
    at TCP.onread (net.js:589:20)
Done in 4.07s.

Related*:

https://stackoverflow.com/questions/11616835/r-command-not-found-bashrc-bash-profile

from relay-starter-kit.

MikePugs avatar MikePugs commented on May 1, 2024

I went to my home computer, deleted the repository, containers, volumes and started over.

It seems to have worked now. Further research suggests that the "fast shutdown" described above is normal behavior.

Here is the output which resulted in what seems to be a successful install on my windows 10 machine


$ docker-compose up
Creating volume "exampleapi_redis" with default driver
Creating volume "exampleapi_db" with default driver
Creating volume "exampleapi_yarn" with default driver
Creating exampleapi_redis_1 ...
Creating exampleapi_db_1 ...
Creating exampleapi_redis_1
Creating exampleapi_db_1 ... done
Creating exampleapi_api_1 ...
Creating exampleapi_api_1 ... done
Creating exampleapi_nginx_1 ...
Creating exampleapi_nginx_1 ... done
Attaching to exampleapi_redis_1, exampleapi_db_1, exampleapi_api_1, exampleapi_nginx_1
redis_1 | 1:C 17 Aug 00:36:53.169 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 17 Aug 00:36:53.169 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1 | 1:C 17 Aug 00:36:53.169 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
db_1 | The files belonging to this database system will be owned by user "postgres".
redis_1 | 1:M 17 Aug 00:36:53.170 * Running mode=standalone, port=6379.
db_1 | This user must also own the server process.
redis_1 | 1:M 17 Aug 00:36:53.170 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
db_1 |
redis_1 | 1:M 17 Aug 00:36:53.170 # Server initialized
redis_1 | 1:M 17 Aug 00:36:53.170 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
db_1 | The database cluster will be initialized with locale "en_US.utf8".
redis_1 | 1:M 17 Aug 00:36:53.170 * Ready to accept connections
db_1 | The default database encoding has accordingly been set to "UTF8".
db_1 | The default text search configuration will be set to "english".
db_1 |
db_1 | Data page checksums are disabled.
db_1 |
db_1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1 | creating subdirectories ... ok
db_1 | selecting default max_connections ... 100
db_1 | selecting default shared_buffers ... 128MB
db_1 | selecting dynamic shared memory implementation ... posix
db_1 | creating configuration files ... ok
db_1 | running bootstrap script ... ok
db_1 | performing post-bootstrap initialization ... sh: locale: not found
db_1 | No usable system locales were found.
db_1 | Use the option "--debug" to see details.
db_1 | ok
db_1 | syncing data to disk ... ok
db_1 |
db_1 | Success. You can now start the database server using:
db_1 |
db_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1 |
db_1 |
db_1 | WARNING: enabling "trust" authentication for local connections
db_1 | You can change this by editing pg_hba.conf or using the option -A, or
db_1 | --auth-local and --auth-host, the next time you run initdb.
db_1 | ****************************************************
db_1 | WARNING: No password has been set for the database.
db_1 | This will allow anyone with access to the
db_1 | Postgres port to access your database. In
db_1 | Docker's default configuration, this is
db_1 | effectively any other container on the same
db_1 | system.
db_1 |
db_1 | Use "-e POSTGRES_PASSWORD=password" to set
db_1 | it in "docker run".
db_1 | ****************************************************
db_1 | waiting for server to start....LOG: could not bind IPv6 socket: Address not available
db_1 | HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
db_1 | LOG: database system was shut down at 2017-08-17 00:36:55 UTC
db_1 | LOG: MultiXact member wraparound protections are now enabled
db_1 | LOG: database system is ready to accept connections
db_1 | LOG: autovacuum launcher started
db_1 | done
db_1 | server started
db_1 | ALTER ROLE
db_1 |
db_1 |
db_1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/initdb.sh
db_1 | CREATE DATABASE
db_1 | CREATE EXTENSION
db_1 | CREATE EXTENSION
db_1 |
db_1 | LOG: received fast shutdown request
db_1 | LOG: aborting any active transactions
db_1 | LOG: autovacuum launcher shutting down
db_1 | LOG: shutting down
db_1 | waiting for server to shut down....LOG: database system is shut down
api_1 | Starting 'run'...
db_1 | done
db_1 | server stopped
db_1 |
db_1 | PostgreSQL init process complete; ready for start up.
db_1 |
db_1 | LOG: database system was shut down at 2017-08-17 00:36:56 UTC
db_1 | LOG: MultiXact member wraparound protections are now enabled
db_1 | LOG: database system is ready to accept connections
db_1 | LOG: autovacuum launcher started
api_1 | Starting 'db-migrate'...
api_1 | Finished 'db-migrate' after 280ms
api_1 | Starting 'build'...
api_1 | src/DataLoaders.js -> build/DataLoaders.js
api_1 | src/app.js -> build/app.js
api_1 | src/db.js -> build/db.js
api_1 | src/email.js -> build/email.js
api_1 | src/passport.js -> build/passport.js
api_1 | src/redis.js -> build/redis.js
api_1 | src/server.js -> build/server.js
api_1 | src/routes/account.js -> build/routes/account.js
api_1 | src/schema/Comment.js -> build/schema/Comment.js
api_1 | src/schema/CommentType.js -> build/schema/CommentType.js
api_1 | src/schema/EmailType.js -> build/schema/EmailType.js
api_1 | src/schema/Node.js -> build/schema/Node.js
api_1 | src/schema/README.md -> build/schema/README.md
api_1 | src/schema/Story.js -> build/schema/Story.js
api_1 | src/schema/StoryType.js -> build/schema/StoryType.js
api_1 | src/schema/User.js -> build/schema/User.js
api_1 | src/schema/UserType.js -> build/schema/UserType.js
api_1 | src/schema/ValidationError.js -> build/schema/ValidationError.js
api_1 | src/schema/index.js -> build/schema/index.js
api_1 | src/emails/welcome/html.hbs -> build/emails/welcome/html.js
api_1 | src/emails/welcome/subject.hbs -> build/emails/welcome/subject.js
api_1 | Finished 'build' after 1417ms
api_1 | Node.js API server is listening on http://api:8080/

Thanks for the help.

from relay-starter-kit.

psyanite avatar psyanite commented on May 1, 2024

Great to hear your issue is now resolved! @MikePugs 👍

I thought I would find the same issue in this thread but it seems not so, my issue is slightly different please let me know if I should open a new issue.

I followed the steps in this article:
https://medium.com/@daveyedwards/how-to-setup-kriasofts-nodejs-api-starter-on-windows-10-a092d6e34882

I also ran docker-compose build because it had permission issues as well installing what I think are the dependencies...

But when I ran docker-compose run this happens:

api_1 | yarn install v1.1.0
api_1 | [1/4] Resolving packages...
api_1 | [2/4] Fetching packages...
api_1 | info [email protected]: The platform "linux" is incompatible with this module.
api_1 | info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
api_1 | [3/4] Linking dependencies...
api_1 | error Could not write file "/usr/src/app/yarn-error.log": "EACCES: permission denied, open '/usr/src/app/yarn-error.log'"
api_1 | error An unexpected error occurred: "EACCES: permission denied, mkdir '/usr/src/app/node_modules'".
api_1 | info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
api_1 | module.js:529
api_1 | throw err;
api_1 | ^
api_1 |
api_1 | Error: Cannot find module 'del'
api_1 | at Function.Module._resolveFilename (module.js:527:15) api_1 | at Function.Module._load (module.js:476:23)
api_1 | at Module.require (module.js:568:17)
api_1 | at require (internal/module.js:11:18)
api_1 | at Object. (/usr/src/app/tools/build.js:13:13)
api_1 | at Module._compile (module.js:624:30)
api_1 | at Object.Module._extensions..js (module.js:635:10) api_1 | at Module.load (module.js:545:32)
api_1 | at tryModuleLoad (module.js:508:12)
api_1 | at Function.Module._load (module.js:500:3)
nas_api_1 exited with code 1

I'd really appreciate any help :( This is a fantastic project!

from relay-starter-kit.

koistya avatar koistya commented on May 1, 2024

@psyanite the error says that there are missing NPM modules (e.g. node_modules/del). You can try removing node_modules folder and install NPM dependencies from scratch:

$ docker-compose run --rm --no-deps api yarn    # Installs deps inside the "api" container

from relay-starter-kit.

psyanite avatar psyanite commented on May 1, 2024

Thank's @koistya! I'll give it a try and open another issue or something if needed, but I think it's a windows bug that there are some permission issues. Cheers 🍰

from relay-starter-kit.

koistya avatar koistya commented on May 1, 2024

I just removed Docker dependency, it should work fine on Windows, all you need is just Node.js 10+ runtime, Yarn and a local or remote instance of PostgreSQL server.

from relay-starter-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.