Bug 269950 - www/qutebrowser: last update - it doesn't start
Summary: www/qutebrowser: last update - it doesn't start
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Roman Bogorodskiy
URL: https://github.com/qutebrowser/qutebr...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-03 23:37 UTC by lumiwa
Modified: 2023-03-15 19:29 UTC (History)
7 users (show)

See Also:
salvadore: maintainer-feedback? (novel)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lumiwa 2023-03-03 23:37:53 UTC
I update Qutebrowser using binary package to qutebrowser v2.5.3 and it doesn't start:
"Arg! qutebrowser crashed unexpectedly"
Log:

==== Exception ====
Traceback (most recent call last):
  File "/usr/local/bin/qutebrowser", line 33, in <module>
    sys.exit(load_entry_point('qutebrowser==2.5.3', 'gui_scripts', 'qutebrowser')())
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/qutebrowser.py", line 245, in main
    return app.run(args)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/app.py", line 123, in run
    init(args=args)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/app.py", line 158, in init
    _init_modules(args=args)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/app.py", line 484, in _init_modules
    history.init(db_path=pathlib.Path(standarddir.data()) / 'history.sqlite',
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/browser/history.py", line 492, in init
    web_history = WebHistory(database=database, progress=progress, parent=parent)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/browser/history.py", line 220, in __init__
    self._between_query = self.database.query('SELECT * FROM History '
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/sql.py", line 213, in query
    return Query(self, querystr, forward_only)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/sql.py", line 300, in __init__
    self._check_ok('prepare', ok)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/sql.py", line 320, in _check_ok
    raise_sqlite_error(msg, error)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/sql.py", line 162, in raise_sqlite_error
    raise BugError(msg, error)
qutebrowser.misc.sql.BugError: Failed to prepare query "SELECT * FROM History where not redirect and not url like "qute://%" and atime > :earliest and atime <= :latest ORDER BY atime desc": "no such column: qute://% Unable to execute statement"
==== Timestamps ====
Launch: Fri Mar  3 18:32:03 2023
Crash: Fri Mar  3 18:32:03 2023

==== Version info ====
         ______     ,,
    ,.-"`      | ,-` |
  .^           ||    |
 /    ,-*^|    ||    |
;    /    |    ||    ;-*```^*.
;   ;     |    |;,-*`         \
|   |     |  ,-*`    ,-"""\    \
|    \   ,-"`    ,-^`|     \    |
 \    `^^    ,-;|    |     ;    |
  *;     ,-*`  ||    |     /   ;;
    `^^`` |    ||    |   ,^    /
          |    ||    `^^`    ,^
          |  _,"|        _,-"
          -*`   ****"""``

qutebrowser v2.5.3
Git commit: 
Backend: QtWebEngine 5.15.2, based on Chromium 83.0.4103.122
Qt: 5.15.8

CPython: 3.9.16
PyQt: 5.15.7

sip: 6.6.2
colorama: 0.4.5
jinja2: 3.1.2
pygments: 2.14.0
yaml: 6.0
adblock: 0.5.0
PyQt5.QtWebEngineWidgets: yes
PyQt5.QtWebEngine: 5.15.6
PyQt5.QtWebKitWidgets: yes
pdf.js: no
sqlite: 3.41.0
QtNetwork SSL: OpenSSL 1.1.1o-freebsd  3 May 2022
Style: QFusionStyle
Platform plugin: xcb
OpenGL: Mesa/X.org, 4.5 (Compatibility Profile) Mesa 22.3.6
Platform: FreeBSD-13.1-RELEASE-p6-amd64-64bit-ELF, 64bit
Linux distribution: FreeBSD 13.1-RELEASE-p7 (unknown)
Frozen: False
Imported from /usr/local/lib/python3.9/site-packages/qutebrowser
Using Python from /usr/local/bin/python3.9
Qt library executable path: /usr/local/libexec/qt5, data path: /usr/local/share/qt5
OS Version: FreeBSD lumiwa.farm.net 13.1-RELEASE-p6 FreeBSD 13.1-RELEASE-p6 GENERIC amd64 amd64

Paths:
cache: /home/ajtim/.cache/qutebrowser
config: /home/ajtim/.config/qutebrowser
data: /home/ajtim/.local/share/qutebrowser
runtime: /tmp/runtime-ajtim/qutebrowser

Autoconfig loaded: yes
Config.py: no config.py was loaded
Uptime: 0:00:00

==== Config ====
<Default configuration>

==== Environment ====
LANG = en_US.UTF-8
PATH = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/ajtim/bin

==== Commandline args ====
--untrusted-args

==== Open Pages ====


==== Command history ====


==== Objects ====

Qt widgets - 0 objects:

Qt objects - 10 objects:
    <PyQt5.QtCore.QAbstractEventDispatcher object at 0x92d06b160>
    <PyQt5.QtGui.QSessionManager object at 0x92d06b1f0>
    <qutebrowser.misc.quitter.Quitter object at 0x8d4d7f5e0>
    <qutebrowser.misc.crashsignal.CrashHandler object at 0x8d58cb430>
    <qutebrowser.misc.crashsignal.SignalHandler object at 0x8d58cbb80>
        <PyQt5.QtCore.QSocketNotifier object at 0x8d58cbca0>
    <qutebrowser.misc.savemanager.SaveManager saveables=OrderedDict([('yaml-config', <qutebrowser.misc.savemanager.Saveable config_opt=None dirty=False filename=None name='yaml-config' save_handler=<bound method YamlConfig._save of <qutebrowser.config.configfiles.YamlConfig object at 0x8d4d7f310>> save_on_exit=False>), ('state-config', <qutebrowser.misc.savemanager.Saveable config_opt=None dirty=False filename=None name='state-config' save_handler=<bound method StateConfig._save of <qutebrowser.config.configfiles.StateConfig object at 0x8d2be31f0>> save_on_exit=True>)])>
    <qutebrowser.browser.history.WebHistory length=0>
        <qutebrowser.browser.history.CompletionHistory object at 0x92d06b040>
        <qutebrowser.browser.history.CompletionMetaInfo object at 0x92d06b0d0>

global object registry - 3 objects:
    config-commands: <qutebrowser.config.configcommands.ConfigCommands object at 0x8d2be3190> (for commands only)
    crash-handler: <qutebrowser.misc.crashsignal.CrashHandler object at 0x8d58cb430> (for commands only)
    save-manager: <qutebrowser.misc.savemanager.SaveManager saveables=OrderedDict([('yaml-config', <qutebrowser.misc.savemanager.Saveable config_opt=None dirty=False filename=None name='yaml-config' save_handler=<bound method YamlConfig._save of <qutebrowser.config.configfiles.YamlConfig object at 0x8d4d7f310>> save_on_exit=False>), ('state-config', <qutebrowser.misc.savemanager.Saveable config_opt=None dirty=False filename=None name='state-config' save_handler=<bound method StateConfig._save of <qutebrowser.config.configfiles.StateConfig object at 0x8d2be31f0>> save_on_exit=True>)])>

==== Debug log ====
18:32:02 DEBUG    init       earlyinit:init_log:276 Log initialized.
18:32:03 DEBUG    init       app:run:85 Main process PID: 13712
18:32:03 DEBUG    init       app:run:87 Initializing directories...
18:32:03 DEBUG    init       standarddir:init:354 Base directory: None
18:32:03 DEBUG    misc       standarddir:_writable_location:274 writable location for ConfigLocation: /home/ajtim/.config
18:32:03 DEBUG    misc       standarddir:_writable_location:274 writable location for AppDataLocation: /home/ajtim/.local/share
18:32:03 DEBUG    misc       standarddir:_writable_location:274 writable location for CacheLocation: /home/ajtim/.cache
18:32:03 DEBUG    misc       standarddir:_writable_location:274 writable location for DownloadLocation: /home/ajtim/Downloads
18:32:03 WARNING  qt         Unknown module:none:0 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-ajtim'
18:32:03 DEBUG    misc       standarddir:_writable_location:274 writable location for RuntimeLocation: /tmp/runtime-ajtim
18:32:03 DEBUG    init       app:run:91 Initializing config...
18:32:03 DEBUG    misc       elf:parse_webenginecore:325 QtWebEngine .so found at /usr/local/lib/qt5/libQt5WebEngineCore.so.5.15.2
18:32:03 DEBUG    misc       elf:parse_webenginecore:331 Got versions from ELF: Versions(webengine='5.15.2', chromium='83.0.4103.122')
18:32:03 DEBUG    init       app:run:94 Initializing application...
18:32:03 DEBUG    misc       elf:parse_webenginecore:325 QtWebEngine .so found at /usr/local/lib/qt5/libQt5WebEngineCore.so.5.15.2
18:32:03 DEBUG    misc       elf:parse_webenginecore:331 Got versions from ELF: Versions(webengine='5.15.2', chromium='83.0.4103.122')
18:32:03 DEBUG    init       darkmode:settings:379 Darkmode variant: qt_515_2
18:32:03 DEBUG    init       app:__init__:555 Commandline args: ['--untrusted-args']
18:32:03 DEBUG    init       app:__init__:556 Parsed: Namespace(basedir=None, config_py=None, version=False, temp_settings=[], session=None, override_restore=False, target=None, backend=None, desktop_file_name='org.qutebrowser.qutebrowser', untrusted_args=True, json_args=None, temp_basedir_restarted=False, enable_webengine_inspector=False, loglevel=None, logfilter=None, loglines=2000, debug=False, json_logging=False, color=True, force_color=False, nowindow=False, temp_basedir=False, no_err_windows=False, qt_arg=None, qt_flag=None, debug_flags=[], command=[], url=[])
18:32:03 DEBUG    init       app:__init__:557 Qt arguments: ['--blink-settings=preferredColorScheme=2', '--enable-features=OverlayScrollbar,ReducedReferrerGranularity', '--disable-features=InstalledApp']
18:32:03 DEBUG    init       app:__init__:562 Initializing application...
18:32:03 DEBUG    ipc        ipc:send_to_running_instance:476 Connecting to /tmp/runtime-ajtim/qutebrowser/ipc-bcf831afd46bbe5ec45129d26bbea703
18:32:03 DEBUG    ipc        ipc:send_to_running_instance:506 No existing instance present (error 2)
18:32:03 DEBUG    init       ipc:send_or_listen:536 Starting IPC server...
18:32:03 DEBUG    ipc        ipc:__init__:210 Not calling setSocketOptions
18:32:03 DEBUG    ipc        ipc:listen:221 Listening as /tmp/runtime-ajtim/qutebrowser/ipc-bcf831afd46bbe5ec45129d26bbea703
18:32:03 DEBUG    init       app:init:145 Starting init...
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.adblockcommands
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.braveadblock
18:32:03 DEBUG    extensions loader:_load_component:134 Running init hook 'init'
18:32:03 INFO     message    message:info:83 Run :adblock-update to get adblock lists.
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.caretcommands
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.hostblock
18:32:03 DEBUG    extensions loader:_load_component:134 Running init hook 'init'
18:32:03 DEBUG    network    hostblock:_should_be_used:83 Configured adblock method auto, adblock library usable: True
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.misccommands
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.readlinecommands
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.scrollcommands
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.utils.blockutils
18:32:03 DEBUG    extensions loader:_load_component:126 Importing qutebrowser.components.zoomcommands
18:32:03 DEBUG    init       app:_init_modules:454 Initializing logging from config...
18:32:03 DEBUG    init       log:init_from_config:554 Configuring RAM loglevel to debug
18:32:03 DEBUG    init       log:init_from_config:561 Configuring console loglevel to info
18:32:03 DEBUG    init       app:_init_modules:458 Initializing save manager...
18:32:03 DEBUG    init       app:_init_modules:464 Checking backend requirements...
18:32:03 DEBUG    init       app:_init_modules:467 Initializing prompts...
18:32:03 DEBUG    init       app:_init_modules:470 Initializing network...
18:32:03 DEBUG    init       app:_init_modules:473 Initializing proxy...
18:32:03 DEBUG    init       app:_init_modules:477 Initializing downloads...
18:32:03 DEBUG    init       app:_init_modules:483 Initializing web history...
18:32:03 DEBUG    sql        sql:run:334 pragma user_version
18:32:03 DEBUG    sql        sql:run:334 SELECT value FROM CompletionMetaInfo WHERE key = :key
18:32:03 DEBUG    sql        sql:run:338     {':key': 'force_rebuild'}
18:32:03 DEBUG    sql        sql:run:334 SELECT value FROM CompletionMetaInfo WHERE key = :key
18:32:03 DEBUG    sql        sql:run:338     {':key': 'excluded_patterns'}
18:32:03 DEBUG    sql        sql:raise_sqlite_error:134 SQL error:
18:32:03 DEBUG    sql        sql:raise_sqlite_error:135 type: StatementError
18:32:03 DEBUG    sql        sql:raise_sqlite_error:136 database text: no such column: qute://%
18:32:03 DEBUG    sql        sql:raise_sqlite_error:137 driver text: Unable to execute statement
18:32:03 DEBUG    sql        sql:raise_sqlite_error:138 error code: 1
18:32:03 DEBUG    init       debug:__exit__:306 Initializing sql/history took 0.004975 seconds.
18:32:03 ERROR    misc       crashsignal:_handle_early_exits:241 Uncaught exception
Traceback (most recent call last):
  File "/usr/local/bin/qutebrowser", line 33, in <module>
    sys.exit(load_entry_point('qutebrowser==2.5.3', 'gui_scripts', 'qutebrowser')())
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/qutebrowser.py", line 245, in main
    return app.run(args)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/app.py", line 123, in run
    init(args=args)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/app.py", line 158, in init
    _init_modules(args=args)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/app.py", line 484, in _init_modules
    history.init(db_path=pathlib.Path(standarddir.data()) / 'history.sqlite',
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/browser/history.py", line 492, in init
    web_history = WebHistory(database=database, progress=progress, parent=parent)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/browser/history.py", line 220, in __init__
    self._between_query = self.database.query('SELECT * FROM History '
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/sql.py", line 213, in query
    return Query(self, querystr, forward_only)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/sql.py", line 300, in __init__
    self._check_ok('prepare', ok)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/sql.py", line 320, in _check_ok
    raise_sqlite_error(msg, error)
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/sql.py", line 162, in raise_sqlite_error
    raise BugError(msg, error)
qutebrowser.misc.sql.BugError: Failed to prepare query "SELECT * FROM History where not redirect and not url like "qute://%" and atime > :earliest and atime <= :latest ORDER BY atime desc": "no such column: qute://% Unable to execute statement"
18:32:03 ERROR    destroy    crashsignal:_get_exception_info:217 Error while getting history: 'command-history'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/misc/crashsignal.py", line 215, in _get_exception_info
    cmd_history = objreg.get('command-history')[-5:]
  File "/usr/local/lib/python3.9/site-packages/qutebrowser/utils/objreg.py", line 248, in get
    return reg[name]
  File "/usr/local/lib/python3.9/collections/__init__.py", line 1058, in __getitem__
    raise KeyError(key)
KeyError: 'command-history'
18:32:03 DEBUG    sql        sql:run:334 SELECT count(*) FROM History
18:32:03 DEBUG    sql        sql:run:334 pragma user_version
18:32:03 DEBUG    sql        sql:run:334 PRAGMA journal_mode=WAL
18:32:03 DEBUG    sql        sql:run:334 PRAGMA synchronous=NORMAL
18:32:03 DEBUG    sql        sql:run:334 select sqlite_version()

I am running FreeBSD 13.1-RELEASE and I never had a problem for now with Qutebrowser.

Thank you very much.
Comment 1 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-03-03 23:48:50 UTC
^Triage: Please use "category/port: summary" format in the bug report title for bugs about specific ports, so that automation asks the port maintainer for maintainer feedback and also assigns the bug to the maintainer if the maintainer also is a committer. Thanks.
Comment 2 Benjamin Takacs 2023-03-04 07:26:50 UTC
The problem here is that qutebrowser wrongly uses double-quotes for string literals in sql[1][2], which was previously hidden by the default option DQS in databases/sqlite3 which was disabled in ports commit 47912ce2e613211aecf6ecdfc58681b7aca0df33

This leads to qutebrowser not fully initialising and then subsequent errors.

(See also: <https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted>)

[1]: https://github.com/qutebrowser/qutebrowser/blob/master/qutebrowser/browser/history.py#L222
[2]: https://github.com/qutebrowser/qutebrowser/blob/master/qutebrowser/browser/history.py#L229
Comment 3 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-03-04 09:03:56 UTC
There is an upstream issue for that: https://github.com/qutebrowser/qutebrowser/issues/7596

I guess rebuilding databases/sqlite3 with DQS enabled could be a temporary workaround.
Comment 4 lumiwa 2023-03-04 11:08:28 UTC
(In reply to Roman Bogorodskiy from comment #3)
I did rebuild databases/sqlite3 with DQS enabled and it works. Thank you.
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2023-03-13 09:44:54 UTC
An upstream fix is now available.
Comment 6 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-03-14 20:28:53 UTC
I've updated the port to 2.5.4. Please let me know if the issue persists still.
Comment 7 nekineki 2023-03-15 13:47:54 UTC
(In reply to Roman Bogorodskiy from comment #6)
I've build qutebrowser from ports (commit e5ac22c) and it works. Thank you.
(I am using databases/sqlite3 binary package.)
Comment 8 Roman Bogorodskiy freebsd_committer freebsd_triage 2023-03-15 19:29:42 UTC
(In reply to nekineki from comment #7)

Great, thanks for checking!