Ошибка узла: не удалось загрузить хук (`http`)! используя узел: 10.19-альпийский docker - PullRequest
0 голосов
/ 26 февраля 2020

Я запускаю приложение узла - если быть точным Konga, и я получаю эту досадную ошибку,

ui-prepare_1      | Preparing database...
ui-prepare_1      | error: A hook (`http`) failed to load!
ui-prepare_1      | error: Failed to prepare database: Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
ui-prepare_1      |     at Object.createSecureContext (_tls_common.js:149:17)
ui-prepare_1      |     at Server.setSecureContext (_tls_wrap.js:1295:27)
ui-prepare_1      |     at Server (_tls_wrap.js:1159:8)
ui-prepare_1      |     at new Server (https.js:64:14)
ui-prepare_1      |     at createServer (https.js:88:10)
ui-prepare_1      |     at _afterLoadingSessionHookIfApplicable (/opt/gluu-gateway-ui/node_modules/sails/lib/hooks/http/initialize.js:87:35)
ui-prepare_1      |     at /opt/gluu-gateway-ui/node_modules/sails/lib/hooks/http/initialize.js:31:18
ui-prepare_1      |     at /opt/gluu-gateway-ui/node_modules/sails/lib/app/private/after.js:91:14
ui-prepare_1      |     at /opt/gluu-gateway-ui/node_modules/async/lib/async.js:721:13
ui-prepare_1      |     at /opt/gluu-gateway-ui/node_modules/async/lib/async.js:52:16
ui-prepare_1      |     at async.forEachOf.async.eachOf (/opt/gluu-gateway-ui/node_modules/async/lib/async.js:236:30)
ui-prepare_1      |     at _parallel (/opt/gluu-gateway-ui/node_modules/async/lib/async.js:712:9)
ui-prepare_1      |     at Object.async.parallel (/opt/gluu-gateway-ui/node_modules/async/lib/async.js:726:9)
ui-prepare_1      |     at Sails.emitter.after (/opt/gluu-gateway-ui/node_modules/sails/lib/app/private/after.js:89:11)
ui-prepare_1      |     at _waitForSessionHookIfApplicable (/opt/gluu-gateway-ui/node_modules/sails/lib/hooks/http/initialize.js:30:15)
ui-prepare_1      |     at Hook.initialize (/opt/gluu-gateway-ui/node_modules/sails/lib/hooks/http/initialize.js:42:7)
ui-prepare_1      |     at Hook.wrapper [as initialize] (/opt/gluu-gateway-ui/node_modules/@sailshq/lodash/lib/index.js:3282:19)
ui-prepare_1      |     at /opt/gluu-gateway-ui/node_modules/sails/lib/hooks/index.js:88:16
ui-prepare_1      |     at /opt/gluu-gateway-ui/node_modules/async/lib/async.js:52:16
ui-prepare_1      |     at /opt/gluu-gateway-ui/node_modules/async/lib/async.js:548:17
ui-prepare_1      |     at /opt/gluu-gateway-ui/node_modules/async/lib/async.js:542:17
ui-prepare_1      |     at _arrayEach (/opt/gluu-gateway-ui/node_modules/async/lib/async.js:85:13)
ui-prepare_1      |     at Immediate.taskComplete [as _onImmediate] (/opt/gluu-gateway-ui/node_modules/async/lib/async.js:541:13)
ui-prepare_1      |     at processImmediate (internal/timers.js:456:21)
ui-prepare_1      |     at process.topLevelDomainCallback (domain.js:137:15)

Я запускаю его на docker-compose с сервисом Postgres 10.x , Мое пользовательское изображение Konga использует node:10.19-alpine. До этого все работало хорошо, но через несколько дней эта ошибка начала возникать. Я пытался изменить версию узла, Postgres версию, и ничего не меняется.

Я не уверен, где еще можно изменить. Я также пытался обновить npm пакеты через npm update, но ничего не работает. Ниже приведены файлы, которые я использовал.

package.json

{
  "name": "kongadmin",
  "version": "4.0.0",
  "description": "Kong admin GUI",
  "keywords": [
    "sails.js",
    "backend",
    "REST",
    "API",
    "JWT",
    "JSON Web Token",
    "Passport.js"
  ],
  "dependencies": {
    "@slack/client": "^3.14.0",
    "async": "1.5.0",
    "barrels": "^1.6.5",
    "bcryptjs": "2.3.0",
    "bluebird": "3.0.5",
    "bower": "^1.8.0",
    "csv-parser": "^1.11.0",
    "dotenv": "^8.2.0",
    "ejs": "^2.5.6",
    "fs": "0.0.1-security",
    "google-auth-library": "^0.10.0",
    "googleapis": "^33.0.0",
    "grunt": "^1.0.3",
    "grunt-contrib-clean": "1.0.0",
    "grunt-contrib-coffee": "^2.0.0",
    "grunt-contrib-concat": "1.0.1",
    "grunt-contrib-copy": "1.0.0",
    "grunt-contrib-cssmin": "1.0.1",
    "grunt-contrib-jst": "1.0.0",
    "grunt-contrib-less": "1.3.0",
    "grunt-contrib-sass": "^1.0.0",
    "grunt-contrib-uglify": "1.0.1",
    "grunt-contrib-watch": "^1.1.0",
    "grunt-sails-linker": "~0.10.1",
    "grunt-sass": "^2.0.0",
    "grunt-sync": "^0.8.0",
    "http-proxy": "^1.16.2",
    "include-all": "^4.0.3",
    "ip": "^1.1.5",
    "jsonwebtoken": "5.4.1",
    "lodash": "^4.17.10",
    "minimist": "^1.2.0",
    "mkdirp": "^0.5.1",
    "moment": "^2.21.0",
    "mongodb": "^2.2.11",
    "mysql": "^2.11.1",
    "node-cron": "^1.1.3",
    "node-sass": "^4.5.0",
    "node-uuid": "^1.4.8",
    "nodemailer": "^4.0.1",
    "nodemailer-mailgun-transport": "^1.3.5",
    "passport": "0.3.0",
    "passport-local": "1.0.0",
    "randomstring": "^1.1.5",
    "rc": "^1.2.8",
    "request": "^2.83.0",
    "request-promise": "^4.2.2",
    "sails": "~0.12.14",
    "sails-disk": "^1.0.0",
    "sails-hook-validation": "0.4.6",
    "sails-mongo": "^1.0.1",
    "sails-mysql": "^1.0.0",
    "sails-postgresql": "^0.11.4",
    "sails-sqlserver": "^0.10.8",
    "sendmail": "^1.1.1",
    "unirest": "^0.5.1",
    "validator": "4.2.1"
  },
  "devDependencies": {
    "chai": "3.4.0",
    "mocha": "2.3.3",
    "should": "7.1.1",
    "supertest": "1.1.0"
  },
  "scripts": {
    "postinstall": "bower --allow-root install",
    "start": "node --harmony app.js",
    "production": "node --harmony app.js --prod",
    "debug": "node debug app.js",
    "test": "mocha",
    "bower-deps": "bower --allow-root install",
    "db-migrate": "export NODE_ENV=production && /bin/bash ./start.sh -c prepare -a postgres -u "
  },
  "main": "app.js",
  "repository": {
    "type": "git",
    "url": "https://github.com/pantsel/konga.git"
  },
  "author": "Tselentis Panagis",
  "license": "MIT"
}

И Dockerfile

FROM node:10.19-alpine AS build

RUN apk add --update --no-cache --virtual \
    build-deps \
    git

ARG GIT_BRANCH=version_4.1

RUN git clone --single-branch --branch ${GIT_BRANCH} https://github.com/mirr254/gluu-gateway-ui.git /gg-tmp \
    && cd /gg-tmp \
    && npm install -g bower \
    && npm --unsafe-perm --production install \
    && npm update -g \
    && rm -rf .svn screenshots test .dockerignore .gitignore 

# ==========================
# Gluu Gateway UI Main Image
# ==========================

FROM node:10.19-alpine

WORKDIR /opt/gluu-gateway-ui

COPY --from=build /gg-tmp /opt/gluu-gateway-ui 

# ================
# Environment vars
# ================

# for DB connections
ENV DB_HOST=kong-database \
    DB_USER=konga \
    DB_PASSWORD=konga \
    DB_PORT=5432 \
    DB_DATABASE=konga \
    DB_POOLSIZE=10 \
    DB_SSL=false \
    DB_ADAPTER=postgres \
    POSTGRES_VERSION=10.x \
    HOOK_TIMEOUT=180000 \
    KONGA_HOOK_TIMEOUT=180000 \
    PORT=1338
#session
ENV SESSION_SECRET=

# certs
ENV SSL_KEY_PATH=/etc/certs/key.pem \
    SSL_CERT_PATH=/etc/certs/certificate.pem

# OXD variables
ENV OXD_SERVER_URL=https://localhost:8553 \
    OP_SERVER_URL=https://demoexample.gluu.org \
    OXD_ID= \
    CLIENT_ID= \
    CLIENT_SECRET= \
    OXD_SERVER_VERSION=4.1 \
    GG_VERSION=4.1 \
    EXPLICIT_HOST=127.0.0.1 \
    GG_UI_REDIRECT_URL_HOST=localhost \
    GG_HOST=localhost 

# ===========
# Metadata
# ===========

LABEL name="gluu-gateway-ui" \
    maintainer="Gluu Inc. <support@gluu.org>" \
    vendor="Gluu Federation" \
    version="4.1.0" \
    release="dev" \
    summary="Gluu Gateway UI" \
    description="User Interface (UI) for Gluu Gateway"

# ====
# misc
# ====
RUN ls
# COPY /scripts/start.sh /opt/gluu-gateway-ui/setup/start.sh
RUN chmod +x ./start.sh 

EXPOSE 1337

ENTRYPOINT ["/bin/sh", "./start.sh"]

и теперь docker-compose

version: "3"

networks:
 kong-net:
  driver: bridge

services:

  #######################################
  # Postgres: The database used by Kong
  #######################################
  kong-database:
    image: postgres:10.6
    restart: always
    networks:
      - kong-net
    environment:
      POSTGRES_USER: kong
      POSTGRES_DB: kong
      POSTGRES_PASSWORD: kong 
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "kong"]
      interval: 5s
      timeout: 5s
      retries: 5
  #######################################
  # Konga/ UI database prepare
  #######################################
  ui-prepare:
    image: gluufederation/gluu-gateway-ui:4.1.0_dev 
    command: "-c prepare -a postgres -u postgresql://kong:kong@kong-database:5432/kong"
    volumes:
      - ./certificate.pem:/etc/certs/certificate.pem
      - ./key.pem:/etc/certs/key.pem
    env_file: 
      - ./.env 
    networks:
      - kong-net
    restart: on-failure
    links:
      - kong-database
    depends_on:
      - kong-database

Буду признателен за любую помощь или предложение.

...