bukem opened a new issue, #25505:
URL: https://github.com/apache/superset/issues/25505

   #### How to reproduce the bug
   1. Install superset version 3.0.0 using docker compose
   2. Start it using `$ TAG=3.0.0 docker compose -f docker-compose-non-dev.yml 
up`
   3. In the output we see the following:
   ```
   ...
   superset_init         | 2023-10-04 
00:13:59,065:INFO:sqlalchemy.engine.Engine:ROLLBACK
   superset_init         | 2023-10-04 00:13:59,065 INFO 
sqlalchemy.engine.Engine ROLLBACK
   superset_init         | INFO  [alembic.runtime.migration] Context impl 
PostgresqlImpl.
   superset_init         | INFO  [alembic.runtime.migration] Will assume 
transactional DDL.
   superset_init         | ERROR [flask_migrate] Error: Can't locate revision 
identified by '4b85906e5b91'
   
   superset_worker       | [2023-10-04 00:13:59,719: INFO/MainProcess] mingle: 
all alone
   superset_worker       | [2023-10-04 00:13:59,749: INFO/MainProcess] 
celery@eae9ce18f86d ready.
   superset_worker       | [2023-10-04 00:13:59,752: INFO/MainProcess] Task 
reports.prune_log[8eaff329-7d30-4c71-a767-8843ce3e1830] received
   superset_worker       | [2023-10-04 00:13:59,754: INFO/MainProcess] Task 
reports.scheduler[fea31b64-1d28-4488-aa65-3b91cbdafe5c] received
   superset_worker       | [2023-10-04 00:13:59,804: INFO/ForkPoolWorker-1] 
Task reports.prune_log[8eaff329-7d30-4c71-a767-8843ce3e1830] succeeded in 
0.04927377501735464s: None
   superset_worker       | [2023-10-04 00:13:59,806: INFO/ForkPoolWorker-2] 
Task reports.scheduler[fea31b64-1d28-4488-aa65-3b91cbdafe5c] succeeded in 
0.0521750440238975s: None
   superset_worker_beat  | [2023-10-04 00:14:00,002: INFO/MainProcess] 
Scheduler: Sending due task reports.scheduler (reports.scheduler)
   superset_worker       | [2023-10-04 00:14:00,005: INFO/MainProcess] Task 
reports.scheduler[1e14046e-0e7d-48bf-9c93-c48f0da43ff1] received
   superset_worker       | [2023-10-04 00:14:00,038: INFO/ForkPoolWorker-1] 
Task reports.scheduler[1e14046e-0e7d-48bf-9c93-c48f0da43ff1] succeeded in 
0.03090966702438891s: None
   
   superset_init exited with code 1
   
   superset_app          | 127.0.0.1 - - [04/Oct/2023:00:14:21 +0000] "GET 
/health HTTP/1.1" 200 2 "-" "curl/7.88.1"
   superset_app          | 127.0.0.1 - - [04/Oct/2023:00:14:51 +0000] "GET 
/health HTTP/1.1" 200 2 "-" "curl/7.88.1"
   superset_worker_beat  | [2023-10-04 00:15:00,020: INFO/MainProcess] 
Scheduler: Sending due task reports.scheduler (reports.scheduler)
   ```
   I added the blank lines myself, to emphasize key parts of the output.
   
   Since "Applying DB migrations" is the first step of `docker-init.sh` and it 
completes with an error, the remaining steps are skipped, namely:
   - Step 2. Create an admin user
   - Step 3. Create default roles and permissions
   - Step 4. Load some data to play with
   
   And looks like it is caused by missing migration file in `superset_app` 
container, because alembic expects to see the following migration:
   ```sql
   select * from alembic_version;
    version_num
   --------------
    4b85906e5b91
   ```
   which corresponds to 
[2023-09-15_12-58_4b85906e5b91_add_on_delete_cascade_for_dashboard_roles.py](https://github.com/apache/superset/blob/master/superset/migrations/versions/2023-09-15_12-58_4b85906e5b91_add_on_delete_cascade_for_dashboard_roles.py)
 but in `superset_app` container there is no such migration:
   ```bash
   root@515f0f33ea47:/app# ls superset/migrations/versions/ | tail -n 5
   
2023-08-09_15-39_4448fa6deeb1__dd_on_delete_cascade_for_embedded_dashboards.py.py
   2023-08-14_09-38_9f4a086c2676_add_normalize_columns_to_sqla_model.py
   2023-08-22_11-09_ec54aca4c8a2_increase_ab_user_email_field_size.py
   __init__.py
   __pycache__
   ```
   
   The file 
[2023-08-22_11-09_ec54aca4c8a2_increase_ab_user_email_field_size.py](https://github.com/apache/superset/blob/master/superset/migrations/versions/2023-08-22_11-09_ec54aca4c8a2_increase_ab_user_email_field_size.py)
 corresponds to one of the previous migrations.
   
   I made sure all migrations are applied and for now I updated the alembic 
data to get rid of the initialization error (see below), but this is more of a 
dirty hack and the problem needs to be solved by properly transferring the 
scripts to the container
   ```sql
   update alembic_version set version_num = 'ec54aca4c8a2' where version_num = 
'4b85906e5b91';
   ```
   
   ### Expected results
   
   No errors during the service start.
   
   ### Actual results
   
   Errors and incorrect configuration, superset_init container status is 
`Exited (1)`
   
   ### Environment
   - superset version: `Superset 3.0.0`
   - python version: `Python 3.9.16`
   
   ```bash
   $ docker ps -a
   CONTAINER ID   IMAGE                                                  
COMMAND                  CREATED          STATUS                      NAMES
   eae9ce18f86d   apachesuperset.docker.scarf.sh/apache/superset:3.0.0   
"/app/docker/docker-…"   20 minutes ago   Up 16 minutes (healthy)     
superset_worker
   d03dbd3b815a   apachesuperset.docker.scarf.sh/apache/superset:3.0.0   
"/app/docker/docker-…"   20 minutes ago   Up 16 minutes (healthy)     
superset_app
   6dc22b0ffded   apachesuperset.docker.scarf.sh/apache/superset:3.0.0   
"/app/docker/docker-…"   20 minutes ago   Exited (1) 16 minutes ago   
superset_init
   69a41f099a15   apachesuperset.docker.scarf.sh/apache/superset:3.0.0   
"/app/docker/docker-…"   20 minutes ago   Up 16 minutes               
superset_worker_beat
   ab393ec6595b   redis:7                                                
"docker-entrypoint.s…"   20 minutes ago   Up 16 minutes               
superset_cache
   e700220c988f   superset-websocket                                     
"docker-entrypoint.s…"   20 hours ago     Exited (1) 20 hours ago     
superset_websocket
   f291bc14ddd1   node:16                                                
"docker-entrypoint.s…"   20 hours ago     Exited (137) 20 hours ago   
superset_node
   ```
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version 
of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to