Closed boarder981 closed 7 years ago
Hello, try to post the uwsgi
container logs, after you see the error in the static
container.
Thank you for the quick response! Here are the pdns-admin-uwsgi
container logs
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1997, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/lib/python2.7/site-packages/werkzeug/contrib/fixers.py", line 152, in __call__
return self.app(environ, start_response)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/powerdns-admin/app/views.py", line 1203, in home
pages = Page.query.all()
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2423, in all
return list(self)
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2571, in __iter__
return self._execute_and_instances(context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2586, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
raise errorvalue
sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1146, "Table 'powerdnsadmin.page' doesn't exist") [SQL: u'SELECT page.id AS page_id, page.name AS page_name, page.title AS page_title, page.url AS page_url, page.icon AS page_icon, page.roles AS page_roles, page.published AS page_published, page.content AS page_content \nFROM page']
[pid: 21|app: 0|req: 1/1] 10.x.x.x () {40 vars in 707 bytes} [Tue Oct 10 14:08:49 2017] GET / => generated 0 bytes in 204 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
announcing my loyalty to the Emperor...
Tue Oct 10 14:08:50 2017 - [emperor] vassal pdns-admin.ini is now loyal
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1997, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/lib/python2.7/site-packages/werkzeug/contrib/fixers.py", line 152, in __call__
return self.app(environ, start_response)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/powerdns-admin/app/views.py", line 382, in custompage
login()
File "/opt/powerdns-admin/app/views.py", line 42, in login
pages = Page.query.all()
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2423, in all
return list(self)
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2571, in __iter__
return self._execute_and_instances(context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2586, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
raise errorvalue
sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1146, "Table 'powerdnsadmin.page' doesn't exist") [SQL: u'SELECT page.id AS page_id, page.name AS page_name, page.title AS page_title, page.url AS page_url, page.icon AS page_icon, page.roles AS page_roles, page.published AS page_published, page.content AS page_content \nFROM page']
[pid: 21|app: 0|req: 2/2] 10.x.x.x () {42 vars in 718 bytes} [Tue Oct 10 14:08:50 2017] GET /favicon.ico => generated 0 bytes in 9 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
So it's looking for the page
table, which doesn't exist in the DB we've been using with the old docker-pdns
. Here are the tables that exist currently
mysql> show tables;
+-------------------------------+
| Tables_in_powerdnsadmin |
+-------------------------------+
| domain |
| domain_setting |
| domain_user |
| history |
| migrate_version |
| role |
| setting |
| user |
+-------------------------------+
8 rows in set (0.00 sec)
I now see that your links to the git repos for the old pdns-admin
and new pdns-admin-uwsgi
are different. They look eerily similar, but I guess the latter uses a different database format.
If I create a new database as outlined here and update the container environment variables accordingly, will it automatically create the necessary tables when I launch the pdns-admin-uwsgi
container?
You don't even need to create new db, it will be created automatically, see https://github.com/pschiffe/docker-pdns/blob/master/pdns-admin-uwsgi/docker-cmd.sh#L40
Just update the env vars, and you should be good to go.
Thank you! I now have the 0x97-Admin GUI running with a different database.
However, now users need to be re-created, history is blank, and settings are default (of course, since it's a fresh DB). I noticed there are some scripts in the container db_migrate.py
and db_upgrade.py
. In order to retain our prior configuration, is there a way to upgrade the original database we were using with the old pdns-admin
image?
I'm sorry, I've never tried that. Maybe even copying the content of some tables from old to new could work (like users and history..)
I have a server running Docker version 17.04.0-ce that has pdns-admin running in a container. I used the
pschiffe/docker-pdns
image, which works fine when launched as follows:I have a separate Docker server, which has been upgraded to version 17.09.0-ce. When the pdns-admin container is launched with the same parameters above, it doesn't work properly. Here is log output when the container is started
When I browse to http://hostip:port, I get the big "nginx error" page. Also, I don't see anything streaming in the container logs when I try to hit it.
Since I see that the
pdns-admin
image is now deprecated, I tried to use the newerpdns-admin-uwsgi
andpdns-admin-static
images. This is how they were launched...Started
pdns-admin-uwsgi
Log output:
...and then started
pdns-admin-static
...I get a 502 when trying to hit it in my browser. Log output...
I have no idea what I'm doing wrong. Have tried a few different things, but can't quite figure this out. Any ideas or solutions would be much appreciated!