Page 1 of 1

Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Fri Oct 22, 2021 4:23 am
by a1dharm
Hi,

One of our client is getting "QuotaExceededError" while using my window client app. I have checked in the logs the indexedDB throwing an error while updating the data. I have checked in the PC there is a lot of space in the disk. After restarting the application, the issue was resolved. But after some time it came again.

We are using Cefsharp 71 version and for some reason, we can not update with the latest cefsharp. So can you please let me know why it is coming and how to increase the chromium cache/memory size through cefsharp. although i am maintaining the cefsharp cache setting. though i am maintaining the cefsharp cache setting in the app.

Error-
{"stack":"Error\n at r_ (resource://localhost/libs/chat.js:2:1319706)\n at new i (resource://localhost/libs/chat.js:2:1321303)\n at IDBTransaction.<anonymous> (resource://localhost/libs/chat.js:2:1355982)\n at IDBTransaction.__zone_symbol__ON_PROPERTYabort (resource://localhost/libs/chat.js:2:1327140)\n at IDBTransaction.k (resource://localhost/libs/chat.js:1:53079)\n at l.invokeTask (resource://localhost/libs/chat.js:1:43621)\n at s.runTask (resource://localhost/libs/chat.js:1:39030)\n at u.invokeTask [as invoke] (resource://localhost/libs/chat.js:1:44671)\n at h (resource://localhost/libs/chat.js:1:56954)\n at IDBTransaction.p (resource://localhost/libs/chat.js:1:57199)"},"name":"AbortError","message":"QuotaExceededError ","inner":{}},

Thanks
Dharmendra

Re: Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Fri Oct 22, 2021 10:58 am
by magreenblatt
In C++ there's CefRequestHandler::OnQuotaRequest where you can specify the quota limit.

Re: Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Fri Oct 22, 2021 3:06 pm
by amaitland
API doc at http://cefsharp.github.io/api/

Find the version you are using. Search for OnQuotaRequest

Re: Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Mon Oct 25, 2021 3:56 am
by a1dharm
I have tried to increase the Quota to 64 GB or more than 10 GB... But not succeed to set the quota. Below code, I am using to increase.

C# - below both which are commented and uncomment code tried in c#.

public override bool OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, long newSize, IRequestCallback callback)
{
//return base.OnQuotaRequest(browserControl, browser, originUrl, newSize, callback);

if (!callback.IsDisposed)
{
using (callback)
{
callback.Continue(true);
return true;
}
}

return false;

}


Calling from java script

navigator.webkitPersistentStorage.requestQuota (
68719476736, function(grantedBytes) {
console.log('we were granted ', grantedBytes, 'bytes');

}, function(e) { console.log('Error', e); }
);


result: Always returning- we were granted 10737418240 bytes (10 gb)

Please suggest am I using the right code to increase the quota?

Re: Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Mon Oct 25, 2021 6:49 am
by ndesktop
C++ cefclient:
Code: Select all
bool ClientHandler::OnQuotaRequest(CefRefPtr<CefBrowser> browser,
                                   const CefString& origin_url,
                                   int64 new_size,
                                   CefRefPtr<CefRequestCallback> callback) {
  CEF_REQUIRE_IO_THREAD();

  static const int64 max_size = 1024 * 1024 * 20;  // 20mb.

  // Grant the quota request if the size is reasonable.
  callback->Continue(new_size <= max_size);
  return true;
}

I think you should call callback->Continue(false); if the new_size is greater than your allowed quota and return true in all cases.

Re: Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Mon Oct 25, 2021 7:22 am
by a1dharm
ndesktop wrote:I think you should call callback->Continue(false); if the new_size is greater than your allowed quota and return true in all cases.


Tried this approach but not working.

Re: Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Wed Oct 27, 2021 6:18 am
by a1dharm
CEF debug logs gives SQLite quota error as well . Has anyone seen this error when Diskspace is available and IndexedDB is also has relatively less data 30-50 MBish . Wee are trying to figureout the root cause which is triggering the QuotaExceededError. Thanks in Advance .

[0705/094242.702:ERROR:backend_impl.cc(1055)] Critical error found -8
[0705/094242.702:ERROR:entry_impl.cc(1037)] No file for c1030362
[0705/094244.328:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0709/004826.967:ERROR:dns_config_service_win.cc(755)] DNS config watch failed.
[0711/075101.525:ERROR:gpu_process_transport_factory.cc(1029)] Lost UI shared context.
[0711/075104.608:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0711/075104.894:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0711/075105.184:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0711/075105.532:ERROR:viz_main_impl.cc(197)] Exiting GPU process due to errors during initialization
[0712/152515.462:ERROR:connection.cc(1945)] Quota sqlite error 13, errno 0: database or disk is full, sql: UPDATE OriginInfoTable SET last_modified_time = ? WHERE origin = ? AND type = ?
[0712/154158.824:ERROR:connection.cc(1945)] Quota sqlite error 1, errno 0: cannot commit - no transaction is active, sql: COMMIT

[0718/091224.724:ERROR:dns_config_service_win.cc(755)] DNS config watch failed.

Re: Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Wed Oct 27, 2021 2:41 pm
by amaitland
The version you are using is very very old and unsupported.

You can use https://github.com/cefsharp/CefSharp.MinimalExample to test version 94.

If it works then you need to work out how to upgrade.

Re: Getting "QuotaExceededError" error on Cefsharp 71.0.2

PostPosted: Thu Oct 28, 2021 12:26 am
by a1dharm
amaitland wrote:The version you are using is very very old and unsupported.

You can use https://github.com/cefsharp/CefSharp.MinimalExample to test version 94.

If it works then you need to work out how to upgrade.


We are too planning to it in coming release.

Its an enterprise app so for now, we are under obligation to minimise the impact area of this issue.
There are a few hundred thousands users to a million users who uses our app.

Our investigation shows that issue has close relation with below four errors. Which are more likely to occurs when app is upgraded to new version and closed forcefully during that process.
Or app remain unused for a few days and hundreds of chat conversations are dumped in indexedDB on next launch.

CEF-debug logs gives below errors which seems to be closely related with "QuotaExceededError" which occurs 318 times across the users and their usage .

Critical error found -8 -151 [ User A , B , C , D]
Quota sqlite error 13 - 52 [B , C]
Quota sqlite error 1 - 85 [B , C]
No file for <c10xxxxxxx> - 107 [A, B , C , D]

Above four errors occurs total 395 times ( We are suspecting that the errors are overlapped and masked each other on some occasions )
Write transaction aborted: QuotaExceededError – 318 times

We are also getting “There is not enough space on the disk.” exception from OS API for both users A and B .

), exception=There is not enough space on the disk.
, stack= at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count)
at System.IO.Compression.DeflateStream.WriteDeflaterOutput(Boolean isAsync)
at System.IO.Compression.DeflateStream.PurgeBuffers(Boolean disposing)
at System.IO.Compression.DeflateStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Compression.CheckSumAndSizeWriteStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()

So in my understanding User A & B really encountered some Disk space or Quota issue .
Where as other two users C,D encountered QuotaExceededError due to some file corruption , lock or deletion issue.

Segregating of the root cause of would help us to give prevention steps to user.