Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Job - DatabaseError: file is encrypted or is not a database

When running this code for connecting to a db through cmd - locally and on the actual server it works fine. But I have set it up on Jenkins and receive the error:

DatabaseError: file is encrypted or is not a database

It seems to be happening on this line:

  self.cursor.execute(*args)

The database class is:

class DatabaseManager(object):
    def __init__(self, db):
        self.conn = sqlite3.connect(db)
        self.cursor = self.conn.cursor()

    def query(self, *args):
        self.cursor.execute(*args)
        self.conn.commit()
        return self.cursor

    def __del__(self):
        self.conn.close()
like image 359
Sam Avatar asked Mar 29 '18 11:03

Sam


2 Answers

The version of python sqlite3 and Command Line sqlite3 can be different. Create your database from the script i.e. code the DB initialization in the script rather than from CMD and it might solve the problem.

like image 154
Shivam Pandya Avatar answered Sep 17 '22 10:09

Shivam Pandya


What is the value of *args ?? is it having the same values that you have when you run it on cmd and through jenkins, Did you check the path and location of DB related from jenkins location??

like image 40
rohit thomas Avatar answered Sep 20 '22 10:09

rohit thomas