Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while trying to create document. #2194

Closed
SalmanZafar1105 opened this issue Aug 20, 2018 · 5 comments
Closed

Error while trying to create document. #2194

SalmanZafar1105 opened this issue Aug 20, 2018 · 5 comments

Comments

@SalmanZafar1105
Copy link

Hi,

We suddenly started facing problems when trying to save documents.

The logs are -

CouchbaseLite DB Verbose: DataFile: begin transaction
CouchbaseLite DB Verbose: KeyStore(default) insert M.84639319-A40B-4EF6-B0FA-E3C85F3377F1
CouchbaseLite WARNING: SQLite error (code 1): no such column: key
CouchbaseLite WARNING: SQLite error compiling statement "INSERT OR IGNORE INTO kv_default (version, body, flags, sequence, key) VALUES (?, ?, ?, ?, ?)": no such column: key
CouchbaseLite DB Info: DataFile: abort transaction
no such column: key

We have tried everything but it doesn't seem to work, although a query just before trying to create the document runs correctly.

From the warnings it looks like an internal issue, although when I checked the database, the column 'key' is present.

I have attached the db.sqlite3
db.sqlite3.zip
.

  • Version: 2.0.3
  • Client OS: iOS 11.3
  • Server: NA
@pasin
Copy link
Contributor

pasin commented Aug 20, 2018

Can you share the document content (keys and values) and document ID?

@SalmanZafar1105
Copy link
Author

Hi,

We were able to solve the issue. It was because of an index we created recently. When we stopped creating this index, the problem went away.

Regarding providing the document content, I was denied permission from my seniors, but the problem was not with the contents as any type of document creation would fail, after creating the faulty index. We also tried by creating just a simple test document with contents -

{
"test" = "test"
}

I also cannot share information about the faulty index. But I can share the following details about it -

  1. It is a FTS index.
  2. It has multiple items (specifically 12), which are a combination of string and array of strings.
  3. The id of a document was also in the items list.

It is by far the most complex index in our project (the rest have a single item), but was able to complete the task, and there are only 3 more indexes apart from this one.

I still don't know where we went wrong. It would be nice if you could let us know what we did wrong (if possible with the information available). Plus more documentation on index would be welcome as there is very little written regarding it.

@pasin
Copy link
Contributor

pasin commented Aug 21, 2018

@SalmanZafar1105 I need more detail for reproducing the issue.

  1. Can you provide the code that is used for creating the FTS index?

  2. If you are specifying the language when creating the FTS index, please provide the exact string?

  3. If you are not specifying the language when creating the FTS index, what is the current locale's language code of the device/simulator that you are using to reproduce the issue? The language code can be checked as follows:

[[NSLocale currentLocale] objectForKey: NSLocaleLanguageCode]
  1. Can you provide sample documents (with random data) that can be used to reproduce the issue?

  2. When reproducing the issue, enable database and query verbose logging and provide the full log?

@djpongh
Copy link

djpongh commented Oct 5, 2018

@SalmanZafar1105, any chance to get the info pasin requested?

@djpongh
Copy link

djpongh commented Oct 12, 2018

If you can get the info, please update and re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants