Step-by-step:
- launch chrome headless
- create three browser contexts using Target.createBrowserContext() method
- create three pages, one page in each browser context
- write cookies in each of the pages using Runtime.evaluate({expression: 'document.cookie = "foo=bar"'})
- close all the pages
Expected: nothing happens.
Actual: chrome issues the following errors into the console, stating that persisting cookies failed:
[0423/195242.492115:ERROR:connection.cc(1888)] Cookie sqlite error 5, errno 0: database is locked, sql: INSERT INTO cookies (creation_utc, host_key, name, value, encrypted_value, path, expires_utc, is_secure, is_httponly, firstpartyonly, last_access_utc, has_expires, is_persistent, priority)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[0423/195242.492204:WARNING:sqlite_persistent_cookie_store.cc(1337)] Could not add a cookie to the DB.
[0423/195242.492296:ERROR:connection.cc(1888)] Cookie sqlite error 5, errno 0: cannot commit transaction - SQL statements in progress, sql: COMMIT
[0423/195242.497113:ERROR:connection.cc(1888)] Cookie sqlite error 5, errno 0: database is locked, sql: INSERT INTO cookies (creation_utc, host_key, name, value, encrypted_value, path, expires_utc, is_secure, is_httponly, firstpartyonly, last_access_utc, has_expires, is_persistent, priority) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[0423/195242.497169:WARNING:sqlite_persistent_cookie_store.cc(1337)] Could not add a cookie to the DB.
[0423/195242.497230:ERROR:connection.cc(1888)] Cookie sqlite error 5, errno 0: cannot commit transaction - SQL statements in progress, sql: COMMIT
This could be the related to the issues with browser contexts reported downstream on Puppeteer repo: https://github.com/GoogleChrome/puppeteer/issues/85#issuecomment-381316766
Comment 1 by bugdroid1@chromium.org
, Apr 25 2018