Unleash / helm-charts

Contains helm-charts for Unleash
Apache License 2.0
41 stars 56 forks source link

Deploy chart using an external database not migrate DB #89

Closed antoniodinovi closed 12 months ago

antoniodinovi commented 1 year ago

Describe the bug

When i try to use an external Postgres to deploy on my kubernetes cluster i get this error

[2023-07-19T14:23:00.479] [ERROR] server-impl.js - Failed to migrate db OperationalError: getaddrinfo ENOTFOUND unleash-dev-user
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
  cause: Error: getaddrinfo ENOTFOUND unleash-dev-user
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'unleash-dev-user'
  },
  isOperational: true,
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'unleash-dev-user'
}
[ERROR] Error: getaddrinfo ENOTFOUND unleash-dev-user
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)

as the error said, it seems that the configuration does'not consider the host configuration

Steps to reproduce the bug

This is my helm configuration

The relevant part of my configuration is

dbConfig:
  database: unleash-dev
  host: 10.*.*.*
  pass: B*********jDq
  port: 5432
  schema: public
  ssl: false
  useExistingSecret:
    key: ""
    name: ""
  user: unleash-dev-user
.....

postgresql:
  auth:
    database: unleash-dev
    password: ***********
    username: unleash-dev-user
  enabled: false
  fullnameOverride: unleash-postgresql

This is the full config

affinity: {}
autoscaling:
  enabled: false
  maxReplicas: 0
  minReplicas: 0
  targetCPUUtilizationPercentage: 70
  targetMemoryUtilizationPercentage: 70
configMaps: {}
containerPort: 4242
dbConfig:
  database: unleash-dev
  host: 10.*.*.*
  pass: B*********jDq
  port: 5432
  schema: public
  ssl: false
  useExistingSecret:
    key: ""
    name: ""
  user: unleash-dev-user
env: []
existingSecrets: ""
fullnameOverride: ""
image:
  pullPolicy: Always
  repository: unleashorg/unleash-server
imagePullSecrets: []
ingress:
  annotations: {}
  className: ""
  enabled: false
  hosts:
  - host: chart-example.local
    paths:
    - path: /
      pathType: ImplementationSpecific
  tls: []
initContainers: []
livenessProbe:
  enabled: true
  initialDelaySeconds: 30
  path: /health
  timeoutSeconds: 10
nameOverride: ""
nodeSelector: {}
podAnnotations: {}
postgresql:
  auth:
    database: unleash-dev
    password: ***********
    username: unleash-dev-user
  enabled: false
  fullnameOverride: unleash-postgresql
readinessProbe:
  enabled: true
  initialDelaySeconds: 30
  path: /health
  periodSeconds: 10
  successThreshold: 5
  timeoutSeconds: 10
replicaCount: 1
resources: {}
secrets: {}
securityContext: {}
service:
  annotations: {}
  loadBalancerIP: ""
  loadBalancerSourceRanges: []
  port: 4242
  type: LoadBalancer
tolerations: []
vpa:
  enabled: false

Expected behavior

I'm expeting that the server start and the migration are applied to my external db

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

3.0.1

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

gastonfournier commented 1 year ago

Hi @antoniodinovi it looks like you're using an old version of the chart. I see your unleash version is 3.0.1 and the current chart is at 5.1.8 https://github.com/Unleash/helm-charts/blob/2b08e4ad03cf8d55f0b67a7f4af1537b6f0437bf/charts/unleash/Chart.yaml#L2

I looked at the chart configuration and it looks ok to me: https://github.com/Unleash/helm-charts/blob/2b08e4ad03cf8d55f0b67a7f4af1537b6f0437bf/charts/unleash/templates/deployment.yaml#L43-L54

As you mentioned it seems it's using your user as the hostname:

  hostname: 'unleash-dev-user'
}
[ERROR] Error: getaddrinfo ENOTFOUND unleash-dev-user

I'm not helm expert but I suspect this was perhaps a bug in an older version? I'll double-check this with our helm experts next week, but I just wanted to get back to you with what I found. If you could try the latest version or confirm this is an older issue, I'd appreciate that

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.