charts icon indicating copy to clipboard operation
charts copied to clipboard

CronJob failing at MySQL connection

Open adrianwnuk opened this issue 1 year ago • 2 comments

Chart Name

bookstack

Chart Version

0.17.2

Bug Description

Hello,

Enabled CronJob failing with the same configuration of environment variables as Deployment.

values.yaml

image:
  tag: "version-v24.05.4"
shelfPermissionsCron:
  enabled: true
env:
  APP_URL: "REDACTED"
  DB_HOST: "REDACTED"
  DB_USER: "admin"
  DB_PASS: "REDACTED"
  DB_DATABASE: "bookstack"
  AUTH_METHOD: "ldap"
  LDAP_SERVER: "REDACTED"
  LDAP_BASE_DN: "REDACTED"
  LDAP_DN: "REDACTED"
  LDAP_PASS: "REDACTED"
  LDAP_USER_FILTER: "REDACTED"
  LDAP_EMAIL_ATTRIBUTE: "mail"
  LDAP_USER_TO_GROUPS: true
  LDAP_REMOVE_FROM_GROUPS: false
  APP_VIEWS_BOOKS: "list"
  APP_VIEWS_BOOKSHELVES: "list"

persistence:
  config:
    enabled: true
    retain: true
    storageClass: "gp3-retain"
    size: 1Gi

Relevant log output

Illuminate\Database\QueryException 

  SQLSTATE[HY000] [1045] Access denied for user 'forge'@'10.100.0.35' (using password: YES) (Connection: mysql, SQL: select `id` from `bookshelves` where `bookshelves`.`deleted_at` is null)

  at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829
    825▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    826▕                 );
    827▕             }
    828▕ 
  ➜ 829▕             throw new QueryException(
    830▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    831▕             );
    832▕         }
    833▕     }

      +19 vendor frames 

  20  /app/www/app/Console/Commands/CopyShelfPermissionsCommand.php:54
      Illuminate\Database\Eloquent\Builder::get()
      +12 vendor frames

adrianwnuk avatar Oct 18 '24 17:10 adrianwnuk

@adrianwnuk The CronJob should contain all envs that the Deployment gets, so I wonder what's different here. If you run kubectl get cronjob NAME -o yaml, do you see the envs you'd expect?

gabe565 avatar Nov 17 '24 05:11 gabe565

I am not sure if I misunderstand the Answer here. But apparently on startup the MariaDB needs too long to start, so the pod throws an error like seen above. Killing the pod after MariaDB is initialized will make it work. Not ideal though

ZimneJonas avatar Jan 28 '25 17:01 ZimneJonas