cache_path parameter which seems to be lost after initialization

591 views
Skip to first unread message

florent....@gmail.com

unread,
Dec 13, 2016, 7:07:30 AM12/13/16
to CEF Python
I have an issue with cache_path parameter which seems to be lost after initialization. Therefore, the localstorage and indexeddb can not persist on the disk.
I tried absolute and relative path in my cefsettings:
settings = {
"cache_path": "cef_cache/",
...
}
cefpython.Initialize(settings, switches)

Directory creation works well for Visited Links files but not for "Local Storage", "databases" or "IndexedDB".
When a javascript application wants to write into IndexedDB, I get this error:

[1211/191256:WARNING:quota_manager.cc(1833)] Create directory failed for path

At the end of this warning message the indicated path seems to be empty referred to the chromium source code: https://cs.chromium.org/chromium/src/storage/browser/quota/quota_manager.cc?type=cs&q=%22Create+directory+failed+for+path%22&sq=package:chromium&l=1833

The strange thing is that Subprocess command line contains disable-databases and i don't know why.
To confirm this issue, chrome://version/ does not have cache path set.
I tested with cefclient binary with --cache-path="cef_cache/" parameter and it works.

Configuration
I am on ubuntu 16.04 and run kivy example (so offscreen mode)
cef version: tested on 53.2dev0, 54.1 and 55.1

Czarek Tomczak

unread,
Dec 13, 2016, 8:10:13 AM12/13/16
to CEF Python
Is the issue also reproducible in other examples? (hello_world.py or gtk2.py) What website do you load, or is it happening on any? Attach debug.log file. Does any of processes crash? To compare with cefclient in OSR mode you need to run "cefclient --off-screen-rendering-enabled --cache-path=....".

florent....@gmail.com

unread,
Dec 13, 2016, 9:25:11 AM12/13/16
to CEF Python
This issue is also reproductible on hello_world.py and gtk2.py examples. You can test with "https://codepen.io/awesom3/pen/Hlfma" url and see the counter does not increment after restarting app.

I tested with "cefclient --off-screen-rendering-enabled --cache-path=...." and it's works.

No processes crash and the app continue to work in incognito mode.

Debug-log:
[CEF Python] Initialize() called
[CEF Python] CefExecuteProcess(): exitCode = -1
[CEF Python] CefInitialize()
[CEF Python] App_OnBeforeCommandLineProcessing_BrowserProcess()
[CEF Python] App: Command line string for the browser process: --browser-subprocess-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/subprocess --no-sandbox --lang=en-US --log-file=debug.log --log-severity=info --resources-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3 --locales-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/locales --remote-debugging-port=50760 --disable-gpu-compositing --disable-gpu --disable-surfaces --enable-begin-frame-scheduling
[CEF Python] BrowserProcessHandler_OnBeforeChildProcessLaunch()
[CEF Python] WindowUtils::IsWindowHandle() not implemented (always True)
[CEF Python] CreateBrowserSync() called
[CEF Python] navigateUrl: chrome://sandbox
[CEF Python] CefBrowser::CreateBrowserSync()
[CEF Python] GetPyBrowser(): creating new PyBrowser, browserId=1
[CEF Python] Switch already set, ignoring: disable-gpu-compositing
[CEF Python] BrowserProcessHandler_OnBeforeChildProcessLaunch()
[CEF Python] CefBrowser::CreateBrowserSync() succeeded
[CEF Python] SendProcessMessage(): message=DoJavascriptBindings, arguments size=1
[CEF Python] App: Command line string for the zygote process: /home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/subprocess --type=zygote --no-sandbox --lang=en-US --locales-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/locales --log-file=debug.log --log-severity=info --resources-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3 --disable-gpu-compositing --disable-gpu --disable-surfaces --enable-begin-frame-scheduling
[1213/151551:INFO:chrome_scheme_handler.cc(265)] Reguest for unknown chrome resource: chrome://sandbox/
[CEF Python] App: Renderer: OnProcessMessageReceived(): DoJavascriptBindings
[CEF Python] App: Renderer: OnContextCreated()
[CEF Python] App: Renderer: DoJavascriptBindingsForFrame(): bindings are set
[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextCreated
[CEF Python] V8ContextHandler_OnContextCreated()
[CEF Python] App: Renderer: DoJavascriptBindingsForFrame(): bindings are set
[CEF Python] App: Renderer: OnContextReleased()
[CEF Python] App: Renderer: OnContextCreated()
[CEF Python] App: Renderer: DoJavascriptBindingsForFrame(): bindings are set
[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextReleased
[CEF Python] V8ContextHandler_OnContextReleased()
[CEF Python] del g_pyFrames[1#2]
[CEF Python] App: Browser: OnProcessMessageReceived(): RemovePythonCallbacksForFrame
[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextCreated
[CEF Python] V8ContextHandler_OnContextCreated()

Czarek Tomczak

unread,
Dec 13, 2016, 9:34:25 AM12/13/16
to CEF Python
I don't see the "Create directory failed for path" error in logs and I also don't see the --disable-databases flag passed anywhere.

florent....@gmail.com

unread,
Dec 13, 2016, 9:56:41 AM12/13/16
to CEF Python
The message error "Create directory failed for path" occurs when the application want to use indexeddb: exemple: https://codepen.io/girliemac/pen/iAvaz

And I get --disable-databases when i did "ps aux | grep python" when the application run:
/home/flo/.virtualenvs/ks/lib/python2.7/site-packages/cefpython3/subprocess --type=renderer --disable-gpu-compositing --no-sandbox --disable-databases --primordial-pipe-token=081D28CE8CD85AA6DD55C7EE4D127FAB --lang=en-US --lang=en-US --locales-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/locales --log-file=debug.log --log-severity=warning --resources-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3 --disable-gpu --disable-surfaces --enable-begin-frame-scheduling --enable-pinch --num-raster-threads=1 --content-image-texture-target=0,0,3553;0,1,355

Czarek Tomczak

unread,
Dec 13, 2016, 10:02:10 AM12/13/16
to CEF Python
Attach complete logs when the "Create directory failed for path" warning occurs.

florent....@gmail.com

unread,
Dec 13, 2016, 10:04:48 AM12/13/16
to CEF Python
[CEF Python] Initialize() called
[CEF Python] CefExecuteProcess(): exitCode = -1
[CEF Python] CefInitialize()
[CEF Python] App_OnBeforeCommandLineProcessing_BrowserProcess()
[CEF Python] App: Command line string for the browser process: --browser-subprocess-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/subprocess --no-sandbox --lang=en-US --log-file=debug.log --log-severity=warning --resources-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3 --locales-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/locales --remote-debugging-port=52618 --disable-gpu-compositing --disable-gpu --disable-surfaces --enable-begin-frame-scheduling

[CEF Python] BrowserProcessHandler_OnBeforeChildProcessLaunch()
[CEF Python] WindowUtils::IsWindowHandle() not implemented (always True)
[CEF Python] CreateBrowserSync() called
[CEF Python] navigateUrl: https://codepen.io/girliemac/pen/iAvaz

[CEF Python] CefBrowser::CreateBrowserSync()
[CEF Python] GetPyBrowser(): creating new PyBrowser, browserId=1
[CEF Python] Switch already set, ignoring: disable-gpu-compositing
[CEF Python] BrowserProcessHandler_OnBeforeChildProcessLaunch()
[CEF Python] CefBrowser::CreateBrowserSync() succeeded
[CEF Python] SendProcessMessage(): message=DoJavascriptBindings, arguments size=1
[CEF Python] App: Command line string for the zygote process: /home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/subprocess --type=zygote --no-sandbox --lang=en-US --locales-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3/locales --log-file=debug.log --log-severity=warning --resources-dir-path=/home/flo/.virtualenvs/ks/local/lib/python2.7/site-packages/cefpython3 --disable-gpu-compositing --disable-gpu --disable-surfaces --enable-begin-frame-scheduling

[CEF Python] App: Renderer: OnProcessMessageReceived(): DoJavascriptBindings
[CEF Python] App: Renderer: OnContextCreated()
[CEF Python] App: Renderer: DoJavascriptBindingsForFrame(): bindings are set
[CEF Python] App: Renderer: DoJavascriptBindingsForFrame(): bindings are set
[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextCreated
[CEF Python] V8ContextHandler_OnContextCreated()
[CEF Python] App: Renderer: OnContextReleased()

[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextReleased
[CEF Python] V8ContextHandler_OnContextReleased()
[CEF Python] del g_pyFrames[1#2]
[CEF Python] App: Browser: OnProcessMessageReceived(): RemovePythonCallbacksForFrame
[CEF Python] App: Renderer: OnContextCreated()
[CEF Python] App: Renderer: DoJavascriptBindingsForFrame(): bindings are set
[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextCreated
[CEF Python] V8ContextHandler_OnContextCreated()
[CEF Python] App: Renderer: OnContextCreated()
[CEF Python] App: Renderer: DoJavascriptBindingsForFrame(): bindings are set
[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextCreated
[CEF Python] V8ContextHandler_OnContextCreated()
[CEF Python] App: Renderer: OnContextReleased()

[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextReleased
[CEF Python] V8ContextHandler_OnContextReleased()
[CEF Python] del g_pyFrames[1#3]

[CEF Python] App: Browser: OnProcessMessageReceived(): RemovePythonCallbacksForFrame
[CEF Python] App: Renderer: OnContextCreated()
[CEF Python] App: Renderer: DoJavascriptBindingsForFrame(): bindings are set
[CEF Python] App: Browser: OnProcessMessageReceived(): OnContextCreated
[CEF Python] V8ContextHandler_OnContextCreated()
[1213/160316:WARNING:quota_manager.cc(1833)] Create directory failed for path
[1213/160316:WARNING:quota_manager.cc(1833)] Create directory failed for path

Czarek Tomczak

unread,
Dec 13, 2016, 12:05:13 PM12/13/16
to CEF Python
I see the warning, but I don't see --disable-databases flag. It would be nice if you could provide complete steps to reproduce your issues (looks like there are more than one). I will test this myself when I find some free time.

florent....@gmail.com

unread,
Dec 13, 2016, 12:13:43 PM12/13/16
to CEF Python
Hi, you can reproduce this error just with hello_world.py example

# Hello world example. Doesn't depend on any third party GUI framework.
# Tested with CEF Python v53+.

from cefpython3 import cefpython as cef
import sys

def main():
print("[hello_world.py] CEF Python {ver}".format(ver=cef.__version__))
print("[hello_world.py] Python {ver}".format(ver=sys.version[:6]))
assert cef.__version__ >= "53.1", "CEF Python v53.1+ required to run this"
sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error
settings = {
"debug": True, # cefpython debug messages in console and in log_file
"log_severity": cef.LOGSEVERITY_WARNING,
"log_file": "debug.log",
"cache_path": "hello_cache/"
}
cef.Initialize(settings)
browser = cef.CreateBrowserSync(url="https://codepen.io/girliemac/pen/iAvaz")
browser.SetClientHandler(ClientHandler())
cef.MessageLoop()
cef.Shutdown()


class ClientHandler(object):

def OnBeforeClose(self, browser):
"""Called just before a browser is destroyed."""
if not browser.IsPopup():
# Exit app when main window is closed.
cef.QuitMessageLoop()


if __name__ == '__main__':
main()

Czarek Tomczak

unread,
Dec 15, 2016, 6:10:42 AM12/15/16
to CEF Python
I can reproduce the issue. Created Issue #283 in the tracker. Reported problem in details on the CEF Forum, link provided in that issue.

Czarek Tomczak

unread,
Dec 15, 2016, 2:08:47 PM12/15/16
to CEF Python
Issue fixed, v55.2 released.

florent....@gmail.com

unread,
Dec 16, 2016, 5:40:58 AM12/16/16
to CEF Python
I confirm that it works. Thank again for your great work and your responsiveness.
Reply all
Reply to author
Forward
0 new messages