New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 836075 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit 28 days ago
Closed: Apr 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Headless: cookie errors in console when creating three+ browser contexts

Project Member Reported by lushnikov@chromium.org, Apr 24 2018

Issue description

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

 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/632461086458b92777294df3874d7c28fe20d68a

commit 632461086458b92777294df3874d7c28fe20d68a
Author: Andrey Lushnikov <lushnikov@chromium.org>
Date: Wed Apr 25 18:11:07 2018

headless: create incognito profiles with Target.createBrowserContext

This patch starts creating off-the-record browser contexts in response
to the Target.createBrowserContext() command.

This should make no difference to the users, but has a few benefits for
us:
- alignes with the non-headless design of Target.createBrowserContext()
  method.
- avoids issues with cookie persistance (see BUG)
- saves some CPU cycles since we don't hit SQLite any more

BUG= 836075 
R=dgozman

Change-Id: I1d33c37e72bc9a2745eda0efae9947f94386417b
Reviewed-on: https://chromium-review.googlesource.com/1025402
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553657}
[modify] https://crrev.com/632461086458b92777294df3874d7c28fe20d68a/headless/lib/browser/protocol/target_handler.cc

Status: Fixed (was: Assigned)

Sign in to add a comment