Flask-migrate: "flask db merge" throws error "No handlers could be found for logger "root""

Created on 25 Mar 2019  ·  7Comments  ·  Source: miguelgrinberg/Flask-Migrate

I'm sure this is something I'm just confused about, but I can't find an answer anywhere else...

From my __init__.py:
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
...
db = SQLAlchemy(app)
migrate = Migrate(app, db)

The migrate/alembic.ini file is the default that was installed when created.
When I try to merge versions:

(flask) bash-4.2$ flask db merge -m "R_1 to R_2"  88c97aeb48be e02ff4fa04fd 046230c10a2f 61d345399fab
No handlers could be found for logger "root"
(flask) bash-4.2$ vi app/__init__.py
(flask) bash-4.2$

This is on Red Hat Linux 7.6, Python 2.7.5, Flask 1.0.2, Flask-Migrate 2.3.1, and Flask-SQLAlchemy 2.3.2.

What am I doing wrong?

question

Most helpful comment

Hello @miguelgrinberg sorry for the noise is working now. Was my fault. Thaks for you response

All 7 comments

Forgot to add, the alembic version is 1.0.8, and for completeness, here is the alembic.ini file:

# A generic, single database configuration.

[alembic]
# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false


# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S

Do you get this error only for the merge command or for all the other commands as well? I'm not really sure, the logging is managed by Alembic not by Flask-Migrate. If it happens for all commands my guess would be that it is something on the Alembic side.

“db migrate” and “db update” both work, as do most of the other commands (history, heads, etc.) So far, only merge generates the error.

I have the same problem with "db migrate" :-(

@eamanu can you show me your alembic.ini file?

Hello @miguelgrinberg sorry for the noise is working now. Was my fault. Thaks for you response

Hello @miguelgrinberg sorry for the noise is working now. Was my fault. Thaks for you response

Really? What a bad response! Can't you tell another people what your fault was?

Was this page helpful?
0 / 5 - 0 ratings