Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to initialize storage: failed to perform migrations: creating migration table: unable to open database file: no such file or directory #3900

Open
3 tasks done
droplet-js opened this issue Dec 30, 2024 · 2 comments

Comments

@droplet-js
Copy link

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.
  • I am not looking for support or already pursued the available support channels without success.

Version

2.41.1

Storage Type

SQLite

Installation Type

Official container image

Expected Behavior

it work well

Actual Behavior

time=2024-12-30T14:05:03.635Z level=INFO msg="Version info" dex_version=v2.41.1 go.version=go1.22.5 go.os=linux go.arch=amd64
time=2024-12-30T14:05:03.635Z level=INFO msg="config issuer" issuer=https://dex.mydomain.com
failed to initialize storage: failed to perform migrations: creating migration table: unable to open database file: no such file or directory

Steps To Reproduce

  1. on centos (it work well on mac)
  2. run docker-compose up -d

Additional Information

No response

Configuration

docker-compose.yaml

  dex:
    container_name: dex
    image: ghcr.io/dexidp/dex:v2.41.1
    restart: unless-stopped
    hostname: dex
#    ports:
#      - 5556
    extra_hosts:
      - host.docker.internal:host-gateway
    configs:
      - source: dex_config
        target: /etc/dex/config.yaml
    volumes:
      - ../dev-ops-repo/dex/data:/data
    environment:
      - DEX_LOG_LEVEL=debug
    command: ["dex", "serve", "/etc/dex/config.yaml"]
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.dex.loadbalancer.server.port=5556"
      - "traefik.http.routers.dex.service=dex"
      - "traefik.http.routers.dex.rule=Host(`dex.${SERVER_DOMAIN:-localhost}`)"
      - "traefik.http.routers.dex.entrypoints=websecure"

configs:
  dex_config:
    content: |
      issuer: https://dex.${SERVER_DOMAIN:-localhost}
      storage:
        type: sqlite3
        config:
          file: /data/dex.db
      web:
        http: 0.0.0.0:5556
      connectors:
      - type: oauth
        id: wecom
        name: WeCom
        config:
          clientID: xxx
          clientSecret: xxx
          redirectURI: https://dex.${SERVER_DOMAIN:-localhost}/callback
          tokenURL: https://qyapi.weixin.gq.com/cgi-bin/gettoken?corpid=xxx&corpsecret=xxx
          authorizationURL: https://login.work.weixin.qq.com/wwlogin/sso/login?login_type=CorpApp&appid=xxx&agentid=xxx
          userInfoURL: https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo
          scopes:
            - snsapi_base
      oauth2:
        skipApprovalScreen: true
        alwaysShowLoginScreen: false
      staticClients:
      - id: whoami
        name: whoami
        secret: xxx
        redirectURIs:
        - https://whoami.${SERVER_DOMAIN:-localhost}/callback

Logs

time=2024-12-30T14:05:03.635Z level=INFO msg="Version info" dex_version=v2.41.1 go.version=go1.22.5 go.os=linux go.arch=amd64
time=2024-12-30T14:05:03.635Z level=INFO msg="config issuer" issuer=https://dex.mydomain.com
failed to initialize storage: failed to perform migrations: creating migration table: unable to open database file: no such file or directory
@droplet-js
Copy link
Author

I have try to use other docker container. it work well to create file.

  geoipupdate:
    container_name: geoipupdate
    image: ghcr.io/maxmind/geoipupdate:v7.1.0
    restart: unless-stopped
    volumes:
      - /path/to/GeoIP:/usr/share/GeoIP
    environment:
      - GEOIPUPDATE_ACCOUNT_ID=xxx
      - GEOIPUPDATE_LICENSE_KEY=xxx
      - "GEOIPUPDATE_EDITION_IDS=GeoLite2-ASN GeoLite2-City GeoLite2-Country" # 空格(特殊处理)
      - GEOIPUPDATE_FREQUENCY=72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant