Skip to content
New issue

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

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

Already on GitHub? # to your account

db.open sometimes fails #772

Closed
dhylands opened this issue Mar 19, 2018 · 0 comments · Fixed by #775
Closed

db.open sometimes fails #772

dhylands opened this issue Mar 19, 2018 · 0 comments · Fixed by #775
Assignees
Milestone

Comments

@dhylands
Copy link
Contributor

I've only run into this once, so it appears to be a race condition of some type.

2018-03-19 16:23:30.739 Loading add-on: http-on-off-adapter
2018-03-19 16:23:30.923 http-on-off: Opening database: /home/dhylands/.mozilla-iot/config/db.sqlite3
2018-03-19 16:23:31.930 http-on-off: events.js:183
2018-03-19 16:23:31.930 http-on-off:       throw er; // Unhandled 'error' event
2018-03-19 16:23:31.930 http-on-off:       ^
2018-03-19 16:23:31.930 http-on-off: 
2018-03-19 16:23:31.930 http-on-off: Error: SQLITE_BUSY: database is locked
2018-03-19 16:23:31.936 Plugin: http-on-off-adapter died, code = 1 restarting...
2018-03-19 16:23:32.118 http-on-off: Opening database: /home/dhylands/.mozilla-iot/config/db.sqlite3
2018-03-19 16:23:33.129 http-on-off: events.js:183
2018-03-19 16:23:33.129 http-on-off:       throw er; // Unhandled 'error' event
2018-03-19 16:23:33.129 http-on-off:       ^
2018-03-19 16:23:33.129 http-on-off: 
2018-03-19 16:23:33.130 http-on-off: Error: SQLITE_BUSY: database is locked
2018-03-19 16:23:33.133 Plugin: http-on-off-adapter died, code = 1 restarting...
2018-03-19 16:23:33.319 http-on-off: Opening database: /home/dhylands/.mozilla-iot/config/db.sqlite3
2018-03-19 16:23:34.325 http-on-off: events.js:183
2018-03-19 16:23:34.325 http-on-off:       throw er; // Unhandled 'error' event
2018-03-19 16:23:34.325 http-on-off:       ^
2018-03-19 16:23:34.325 http-on-off: 
2018-03-19 16:23:34.325 http-on-off: Error: SQLITE_BUSY: database is locked
2018-03-19 16:23:34.327 Plugin: http-on-off-adapter died, code = 1 restarting...
2018-03-19 16:23:34.514 http-on-off: Opening database: /home/dhylands/.mozilla-iot/config/db.sqlite3
2018-03-19 16:23:35.521 http-on-off: events.js:183
2018-03-19 16:23:35.521 http-on-off:       throw er; // Unhandled 'error' event
2018-03-19 16:23:35.521 http-on-off:       ^
2018-03-19 16:23:35.522 http-on-off: 
2018-03-19 16:23:35.522 http-on-off: Error: SQLITE_BUSY: database is locked
2018-03-19 16:23:35.523 Plugin: http-on-off-adapter died, code = 1 restarting...

Things recovered in this case (because http-on-off-adapter eventually restarted without a conflict), but we should probably try to deal with the SQLITE_BUSY error a little better inside db.open.

mrstegeman pushed a commit to mrstegeman/gateway that referenced this issue Mar 20, 2018
While not a complete fix, this is probably the best we can do to
handle this gracefully.

Fixes WebThingsIO#772
@ghost ghost assigned mrstegeman Mar 20, 2018
@ghost ghost added the review label Mar 20, 2018
mrstegeman pushed a commit that referenced this issue Mar 20, 2018
While not a complete fix, this is probably the best we can do to
handle this gracefully.

Fixes #772
@ghost ghost removed the review label Mar 20, 2018
@mrstegeman mrstegeman added this to the 0.4 milestone Jan 9, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants