Starting the container with Populate_database env does nothing wit mysql.
- Dominant language
- Shell
- Stars
- 769
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
Please see the below kubernetes config.
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: wallabag
namespace: cloud
labels:
app: wallabag
type: cloud
spec:
selector:
matchLabels:
app: wallabag
type: cloud
strategy:
type: Recreate
template:
metadata:
labels:
app: wallabag
type: cloud
spec:
containers:
- image: docker.local:5000/wallabag/wallabag:latest
imagePullPolicy: Always
name: wallabag
resources:
requests:
memory: 256Mi
cpu: 50m
env:
- name: SYMFONY__ENV__DATABASE_DRIVER
value: pdo_mysql
- name: SYMFONY__ENV__DATABASE_HOST
value: mysql.db
- name: SYMFONY__ENV__DATABASE_PORT
value: "3306"
- name: SYMFONY__ENV__DATABASE_USER
value: wallabag
- name: SYMFONY__ENV__DATABASE_NAME
value: wallabag_live
- name: SYMFONY__ENV__DATABASE_CHARSET
value: utf8mb4
- name: SYMFONY__ENV__DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: wallabag-secrets
key: mysqlpassword
- name: SYMFONY__ENV__REDIS_HOST
value: wallabag-redis
- name: SYMFONY__ENV__MAILER_HOST
value: example.com
- name: SYMFONY__ENV__MAILER_USER
value: wallabag@example.com
- name: SYMFONY__ENV__MAILER_PASSWORD
valueFrom:
secretKeyRef:
name: wallabag-secrets
key: smtppassword
- name: SYMFONY__ENV__FROM_EMAIL
value: bm-noreply@example.com
- name: SYMFONY__ENV__TWOFACTOR_SENDER
value: bm-noreply@example.com
- name: SYMFONY__ENV__FOSUSER_REGISTRATION
value: "false"
- name: SYMFONY__ENV__DOMAIN_NAME
value: "https://wallabag.example.com"
- name: SYMFONY__ENV__SERVER_NAME
value: Wallabag
- name: POPULATE_DATABASE
value: "True"
```
Error i am facing:
```
10.244.167.145 - - [06/Dec/2021:20:13:31 +0000] "GET /login HTTP/1.1" 500 31 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
2021/12/06 20:20:56 [error] 195#195: *5 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: wallabag_internal_setting in /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:67
Stack trace:
#0 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(67): PDO->prepare('SELECT t0.value...', Array)
#1 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(903): Doctrine\DBAL\Driver\PDOConnection->prepare('SELECT t0.value...')
#2 /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(726): Doctrine\DBAL\Connection->executeQuery('SELECT t0.value...', Array, Array)
#3 /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(193): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(Array, NULL, NULL, Array, NULL, 1, NULL)
#4 /var/www/wallabag/vendor/craue/config-bundle/Util/Config.php(73): Doctrine\ORM\EntityRepository->findOneBy(Array)
#5 /var/www/wallabag" while reading response header from upstream, client: 10.244.167.145, server: _, request: "GET /login HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "wallabag.example.com"
10.244.167.145 - - [06/Dec/2021:20:20:56 +0000] "GET /login HTTP/1.1" 500 31 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
```
Please help in resolving this issue.
Contributor guide
No contributing guide indexed for this repository
Research direction
No repository file or test is named. Start by tracing the container startup path that reads POPULATE_DATABASE and compare database initialization for pdo_mysql in the reported Kubernetes environment. Reproduce the missing-table failure, then verify that a fresh MySQL-backed container creates wallabag_internal_setting before /login.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, kubernetes, mysql, php, shell, symfony
- Domain
- databases, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100