airbnb/knowledge-repo

Posts don't show and can't be accessed when using MySQL DB

Open

#430 opened on Jun 9, 2018

View on GitHub
 (29 comments) (0 reactions) (0 assignees)Python (5,406 stars) (709 forks)batch import
bughelp wanted

Description

Auto-reviewers: @NiharikaRay @matthewwardrop @earthmancash @danfrankj

I'm trying to deploy knowledge repo with a database backend. The database is running on a different place than the knowledge_repo server and is accessed over an SSH tunnel.

It seems that Knowledge Repo can read from and write to this database just fine.

However, for whatever reason, no posts are showing up. And it's not just in the feed, but they also can't be accessed directly via their path. I looked in the database itself and the posts are there in the repository table, however, the posts table that knowledge repo makes itself is empty. If I try to re-add the posts I see in the repository table, I expectedly get the error that their paths already exist.

I tried also setting SQLALCHEMY_DATABASE_URI to use sqlite, but that didn't seem to help.

Another thing I tried was running a MySQL DB on a local docker container, and the same issue persists.

Version 0.8.1 of Knowledge Repo, on a Mac, with python 3 if that helps.

I'm sort of at a loss as to why this could be happening.

In the logs, I see stuff like this:

    _mysql.connection.query(self, query)
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: 'SELECT index_metadata.id AS index_metadata_id, index_metadata.type AS index_metadata_type, index_metadata.name AS index_metadata_name, index_metadata.value AS index_metadata_value, index_metadata.updated_at AS index_metadata_updated_at \nFROM index_metadata \nWHERE index_metadata.type = %s AND index_metadata.name = %s \n LIMIT %s'] [parameters: ('lock', 'master_check', 1)] (Background on this error at: http://sqlalche.me/e/e3q8)

During startup of knowledge repo I also see this:

WARNING:knowledge_repo.app.index:Master indexing thread has died. Restarting...

Contributor guide