Error during the database migration - New Deployment in AKS

43 views
Skip to first unread message

John Doe

unread,
Oct 30, 2024, 1:10:40 AM10/30/24
to Wazuh | Mailing List
Hi,

I am currently trying to deploy Wazuh in my AKS (Azure Kubernetes Service) cluster. I am always getting the following error:

Error during the database migration. Restoring the previous database file
Error details: (sqlite3.OperationalError) database is locked
[SQL:
CREATE TABLE runas_token_blacklist (
        nbf_invalid_until INTEGER NOT NULL,
        is_valid_until INTEGER NOT NULL,
        PRIMARY KEY (nbf_invalid_until),
        CONSTRAINT nbf_invalid_until_invalidation_rule UNIQUE (nbf_invalid_until)
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Traceback (most recent call last):
  File "/var/ossec/framework/python/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
    self.dialect.do_execute(
  File "/var/ossec/framework/python/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked


I followed the steps in https://documentation.wazuh.com/current/deployment-options/deploying-with-kubernetes/kubernetes-deployment.html including setting the storage class to a valid Azure storage class. 

Does anybody knows whether the error occurs because Wazuh can't handle that storage class, has some general issues with Azure or for another reason? Does anybody know how to fix this or debug it? 

Md. Nazmur Sakib

unread,
Oct 30, 2024, 3:13:56 AM10/30/24
to Wazuh | Mailing List

Hi John,



The error message you provided indicates that there is a problem with the database being locked. This could be caused by multiple processes trying to access the same database at the same time.

We recommend checking if there are any other processes running that could be accessing the database and causing the lock.



Depending on the type of cluster you’re running, the Storage Class may have a different provisioner.


You can check yours by running kubectl get sc.


you must edit the file envs/local-env/storage-class.yaml and set up this provisioner.

Kindly share with me the output of the following commands so I can troubleshoot further:

  kubectl describe pod "Worker pod"

  kubectl logs "Worker pod"


It is possible to deploy AKS in the same way it's done with EKS.

Just follow our repository on GitHub for EKS and make the changes for AKS.  

  

Let me know the update on the issue

Reply all
Reply to author
Forward
0 new messages