Bug 182795

Summary: Log the error message when failing to open the database
Product: WebKit Reporter: youenn fablet <youennf>
Component: Service WorkersAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, cdumez, commit-queue, fred.wang, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description youenn fablet 2018-02-14 09:27:27 PST
Log the error message when failing to open the database
Comment 1 youenn fablet 2018-02-14 09:30:12 PST
Created attachment 333806 [details]
Patch
Comment 2 youenn fablet 2018-02-14 09:31:36 PST
Looking at the code, it is the first time we would expose SQLiteDatabase::lastErrorMsg() in release log.
AIUI, it does not contain any privacy sensitive information.
Comment 3 WebKit Commit Bot 2018-02-15 17:30:41 PST
Comment on attachment 333806 [details]
Patch

Rejecting attachment 333806 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 333806, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
rdparty/autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://webkit-queues.webkit.org/results/6526217
Comment 4 WebKit Commit Bot 2018-02-15 18:27:19 PST
Comment on attachment 333806 [details]
Patch

Rejecting attachment 333806 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 333806, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
rdparty/autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://webkit-queues.webkit.org/results/6527099
Comment 5 WebKit Commit Bot 2018-02-15 18:45:13 PST
Comment on attachment 333806 [details]
Patch

Clearing flags on attachment: 333806

Committed r228548: <https://trac.webkit.org/changeset/228548>
Comment 6 WebKit Commit Bot 2018-02-15 18:45:15 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-02-15 18:46:19 PST
<rdar://problem/37592399>
Comment 8 Frédéric Wang (:fredw) 2018-02-16 03:35:52 PST
@Youenn: It looks like this patch breaks the iOS simulator debug bot:

In file included from /Volumes/Data/slave/ios-simulator-11-debug/build/WebKitBuild/Debug-iphonesimulator/DerivedSources/WebCore/unified-sources/UnifiedSource470.cpp:1:
./workers/service/server/RegistrationDatabase.cpp:111:98: error: using 'public' format specifier annotation outside of os_log()/os_trace() [-Werror,-Wformat]
        RELEASE_LOG_ERROR(ServiceWorker, "Failed to open Service Worker registration database: %{public}s", errorMessage->utf8().data());
                                                                                               ~~^~~~~~~~
In file included from /Volumes/Data/slave/ios-simulator-11-debug/build/WebKitBuild/Debug-iphonesimulator/DerivedSources/WebCore/unified-sources/UnifiedSource470.cpp:1:
In file included from /Volumes/Data/slave/ios-simulator-11-debug/build/Source/WebCore/WebCorePrefix.h:171:
In file included from /Volumes/Data/slave/ios-simulator-11-debug/build/WebKitBuild/Debug-iphonesimulator/usr/local/include/wtf/FastMalloc.h:26:
In file included from /Volumes/Data/slave/ios-simulator-11-debug/build/WebKitBuild/Debug-iphonesimulator/usr/local/include/wtf/StdLibExtras.h:34:
/Volumes/Data/slave/ios-simulator-11-debug/build/WebKitBuild/Debug-iphonesimulator/usr/local/include/wtf/Assertions.h:449:59: note: expanded from macro 'RELEASE_LOG_ERROR'
#define RELEASE_LOG_ERROR(channel, format, ...) LOG_ERROR(format, ##__VA_ARGS__)
                                                          ^
/Volumes/Data/slave/ios-simulator-11-debug/build/WebKitBuild/Debug-iphonesimulator/usr/local/include/wtf/Assertions.h:418:80: note: expanded from macro 'LOG_ERROR'
#define LOG_ERROR(...) WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__)
                                                                               ^
1 error generated.
Comment 9 youenn fablet 2018-02-16 08:57:13 PST
Thanks Fred, will look at it.
Comment 10 youenn fablet 2018-02-16 09:51:33 PST
Reopening to attach new patch.
Comment 11 youenn fablet 2018-02-16 09:51:34 PST
Created attachment 334047 [details]
Patch
Comment 12 WebKit Commit Bot 2018-02-16 10:48:36 PST
Comment on attachment 334047 [details]
Patch

Clearing flags on attachment: 334047

Committed r228562: <https://trac.webkit.org/changeset/228562>
Comment 13 WebKit Commit Bot 2018-02-16 10:48:37 PST
All reviewed patches have been landed.  Closing bug.
Comment 14 Ryan Haddad 2018-02-16 11:28:10 PST
(In reply to WebKit Commit Bot from comment #12)
> Comment on attachment 334047 [details]
> Patch
> 
> Clearing flags on attachment: 334047
> 
> Committed r228562: <https://trac.webkit.org/changeset/228562>

The failure is different now:
./workers/service/server/RegistrationDatabase.cpp:113:19: error: use of undeclared identifier 'ServiceWorker'
        LOG_ERROR(ServiceWorker, "Failed to open Service Worker registration database: %s", errorMessage->utf8().data());
                  ^
1 error generated.

https://build.webkit.org/builders/Apple%20iOS%2011%20Simulator%20Debug%20%28Build%29/builds/3907
Comment 15 Chris Dumez 2018-02-16 11:36:14 PST
(In reply to Ryan Haddad from comment #14)
> (In reply to WebKit Commit Bot from comment #12)
> > Comment on attachment 334047 [details]
> > Patch
> > 
> > Clearing flags on attachment: 334047
> > 
> > Committed r228562: <https://trac.webkit.org/changeset/228562>
> 
> The failure is different now:
> ./workers/service/server/RegistrationDatabase.cpp:113:19: error: use of
> undeclared identifier 'ServiceWorker'
>         LOG_ERROR(ServiceWorker, "Failed to open Service Worker registration
> database: %s", errorMessage->utf8().data());
>                   ^
> 1 error generated.
> 
> https://build.webkit.org/builders/
> Apple%20iOS%2011%20Simulator%20Debug%20%28Build%29/builds/3907

Should be fixed by <https://trac.webkit.org/changeset/228568>.