Encountering Connection Timeout Issue in Docker Container on Server Without Internet Access

Open
#9,073 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, node.js, typescript
Domain
backend, devops

Research direction

Start with the two-stage Dockerfile and package.json scripts, then trace the keystone dev startup step that generates Prisma schemas. Reproduce the failure in an offline container and compare it with Prisma issue 19729; done should mean the application starts without an unavailable network download.

Written by the indexing model from the issue text.

Description

Issue Description:

When running Keystone in a Docker container on a server without internet access, I encountered a connection timeout issue related to downloading openssl(I have installed openssl in Dokcerfile with RUN apt-get update -y && apt-get install -y openssl).

Steps to Reproduce:
  1. Build Docker image with the following Dockerfile
FROM node:18 AS builder
WORKDIR /src
COPY package.json yarn.lock    /src/
RUN yarn install --ignore-scripts
COPY . /src


FROM node:18-slim
RUN apt-get update -y && apt-get install -y openssl
WORKDIR /app
COPY --from=builder /src/ /app/
EXPOSE 3000
CMD [ "yarn", "dev" ]
  1. Run the container in a server without internet access.
    Error Message:
yarn run v1.22.19
$ concurrently "keystone dev" "npm run build:css"
[1]
[1] > [email protected] build:css
[1] > tailwindcss -i ./admin/styles/input.css -o ./admin/styles/output.css --watch
[1]
[1]
[1] Rebuilding...
[1]
[1] Done in 265ms.
[0] ✨ Starting Keystone
[0] ⭐️ Server listening on 0.0.0.0:3000 (http://localhost:3000/)
[0] ⭐️ GraphQL API available at /api/graphql
[0] ✨ Generating GraphQL and Prisma schemas
[0] FetchError: request to https://binaries.prisma.sh/all_commits/4bc8b6e1b66cb932731fb1bdbbc550d1e010de81/debian-openssl-3.0.x/migration-engine.sha256 failed, reason: connect ETIMEDOUT 172.67.4.173:443
[0]     at ClientRequest.<anonymous> (/app/node_modules/@prisma/engines/dist/index.js:22625:14)
[0]     at ClientRequest.emit (node:events:517:28)
[0]     at ClientRequest.emit (node:domain:489:12)
[0]     at TLSSocket.socketErrorListener (node:_http_client:501:9)
[0]     at TLSSocket.emit (node:events:517:28)
[0]     at TLSSocket.emit (node:domain:489:12)
[0]     at emitErrorNT (node:internal/streams/destroy:151:8)
[0]     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
[0]     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
[0]   type: 'system',
[0]   errno: 'ETIMEDOUT',
[0]   code: 'ETIMEDOUT'
[0] }
[0] keystone dev exited with code 1
Expected Behavior:

The application should run successfully in a Docker container even without internet access.

Additional Information:

package.json

{
  "name": "keystone-app",
  "version": "1.0.2",
  "private": true,
  "scripts": {
    "dev": "concurrently \"keystone dev\" \"npm run build:css\"",
    "start": "keystone start",
    "build": "keystone build",
    "postinstall": "keystone build --no-ui --frozen",
    "build:css": "tailwindcss -i ./admin/styles/input.css -o ./admin/styles/output.css --watch"
  },
  "dependencies": {
    "@keystone-6/auth": "^7.0.0",
    "@keystone-6/core": "^5.0.0",
    "@keystone-6/fields-document": "^7.0.0",
    "env-var": "^7.4.1",
    "typescript": "^4.9.5"
  },
  "devDependencies": {
    "autoprefixer": "^10.4.19",
    "concurrently": "^8.2.2",
    "postcss": "^8.4.38",
    "tailwindcss": "^3.4.1"
  }
}

Related issue https://github.com/prisma/prisma/issues/19729

Dominant language
TypeScript
Stars
10k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
38

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from keystonejs/keystone

All issues in keystonejs/keystone

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.