[MAC] CEF Fatal Error: failed to update cookie - app crashes

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

[MAC] CEF Fatal Error: failed to update cookie - app crashes

Postby mishka » Tue Nov 07, 2017 3:51 pm

Hi,

I am running multiple CEF applications under MAC OS with shared cache folder(set via settings.cache_path) and they start crashing (both Debug and Release) in 5-10 minutes while CEF internal code tries to simultaneously access the database.
Code: Select all
[1107/140139.583391:ERROR:connection.cc(1954)] Cookie sqlite error 5, errno 0: database is locked, sql: UPDATE cookies SET last_access_utc=? WHERE creation_utc=?
[1107/140139.583536:FATAL:sqlite_persistent_cookie_store.cc(1182)] Check failed: false. Could not update cookie last access time in the DB.

The log also prints out that duplicate cookies for the same host are found.

I am using Mac OS-X CEF3 3071.1649, but the newest CEF MAC OS-X build 3202.1678 crashes as well.

Windows CEF applications using the shared cache folder and launched together, never crashed.
Looks like it is a Mac specific behavior.

Each application runs only one CEF Browser, which loads an HTML5 game using a unique URL. This game uses cookies from time to time. Making a separate cache folder for each game type makes no sense, because the game of the same type may be played in multiple CEF application simultaneously, resulting in the same FATAL_ERROR, which shuts down the application. The benefit of using persistent cache is obvious when one application is launched at a time.

Yes, I have read the forum regarding the CEF not supporting simultaneous access to the same cache folder at the same time, but why does WIndows CEF applications never have a FATAL_ERROR and crash in the same situation ?
Window log produces cache folder move errors only:
Code: Select all
[1031/131455.121:ERROR:cache_util_win.cc(20)] Unable to move the cache: 5
[1031/131455.121:ERROR:cache_util.cc(134)] Unable to move cache folder C:\Users\<User>\AppData\Local\Temp\a<appName>\GPUCache to C:\Users\<User>\AppData\Local\Temp\<appName>\old_GPUCache_000
[1031/131455.121:ERROR:cache_creator.cc(134)] Unable to create cache
[1031/131455.121:ERROR:shader_disk_cache.cc(570)] Shader Cache Creation failed: -2

Would you please look into this specific mac issue ?

Thank you.
mishka
Newbie
 
Posts: 2
Joined: Tue Nov 07, 2017 3:06 pm

Re: [MAC] CEF Fatal Error: failed to update cookie - app cra

Postby magreenblatt » Tue Nov 07, 2017 5:52 pm

Don't use the same cache folder for multiple application instances running at the same time.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: [MAC] CEF Fatal Error: failed to update cookie - app cra

Postby mishka » Wed Nov 08, 2017 2:58 pm

I have set a unique storage path for the cookie manager in each application instance and the crash does not happen anymore:
Code: Select all
CefRequestContext::GetGlobalContext()->GetDefaultCookieManager(0)->SetStoragePath(app_unique_cookie_path, false, 0);


This cache folder was added inside the common cache folder like commonCacheFolder/CookiesCache/uniqueAppInsatnceFolder.

1) Does it mean that the global context is unique for each application instance?

2) Is it a proper approach compared to the adding a custom CefRequestContextHandler class to the CreateBrowser parameters with a CefCookieManager's path initialized to the unique path as in the http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=12534?
Last edited by mishka on Wed Nov 08, 2017 3:16 pm, edited 1 time in total.
mishka
Newbie
 
Posts: 2
Joined: Tue Nov 07, 2017 3:06 pm

Re: [MAC] CEF Fatal Error: failed to update cookie - app cra

Postby magreenblatt » Wed Nov 08, 2017 3:11 pm

All cache path values (CefSettings and CefRequestContextSettings) should be different for different application instances.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 34 guests