trinv / PowerDNS

6 stars 15 forks source link

[Powerdns-Admin] sqlalchemy.exc.PendingRollbackError #8

Open trinv opened 4 months ago

trinv commented 4 months ago

I'm installing version 4.9.0 on Debian 11. After I run the command flask db upgrade I go to the Web and specify IP:Port API_Key Version and it gives an error 403

sqlalchemy.exc.PendingRollbackError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: UPDATE statement on table 'sessions' expected to update 1 row(s); 0 were matched.
Message from the Web
HTTP 403 Error Oops! Access Denied
You don't have permission to access this page You may return to the dashboard.

Reported from users

trinv commented 1 month ago

Solution: 1.Remove the function check sessions expired in powerdnsadmin/routes/user.py

    # Clean up expired sessions in the database
    # if Setting().get('session_type') == 'sqlalchemy':
    #    from ..models.sessions import Sessions
    #   Sessions().clean_up_expired_sessions()
  1. Remove the table name: sessions in DB (powerdns) & restart Mariadb/MySQL
  2. Restart powerdns-admin & check it again