Proxy issue in Extensions Manager

Hi, when using work computer (MacOS, network with proxy) I’ve been having the issue that extensions cannot be downloaded from the Extensions Manager.

Extensions show, but fails to retrieve metadata and to install them. The error shows:

Execution of PAC script at "http%3A%2F%2Fproxy.[...]" failed: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)

(I replaced my institution by [...])

I looked a bit more into it and the issue was reported here [QTBUG-98024] "Execution of PAC script … failed" on macOS, invalid URL escaping of proxy auto configuration URL - Qt Bug Tracker . Relating to an issue in Qt 5.12 that was solved for Qt 6.0.

I’ve been manually installing extensions and helping other in my institution to do so, but this has become a bit cumbersome and annoying for new users.

I guess if Slicer updates the qt version this issue could be solved. Are there planes for that? If not, is there a way to fix this from another side? I’ve been looking a bit, but thought to ask to get better directions.

I found this weird since downloads from other points of the application (such as downloading sample data) work flawlessly.

Thanks a lot for the help.

Thanks for the report @simonoxen. We will switch to Qt 6.x as soon as feasible, I don’t know the status of all the components but I suspect it will happen in the next year or sooner for the preview version. It might make sense to write a small python script that downloads using non-Qt methods and runs the installation if your manual workaround is to cumbersome.

1 Like

Qt6 raises minimum platform requirements and it requires solid support in all underlying libraries, so unless there are several other pressing issues that Qt6 solves then end of this year could be a realistic target. I added an issue and tentatively targeted it for Slicer-5.2.

It seems that the fix for this particular issue is a single-line change in Qt, so we could possibly patch it in our Qt builds. @jcfr do we still build Qt from source on factory machines?

@simonoxen could you try if you build Qt from source and apply this patch then it fixes the issue for you?

1 Like

Thanks for the replies.

Doing this fixes the issue on my work computer. I built and packaged Slicer on my personal computer and then installed Slicer there, now Extensions can be downloaded.

Before

After

There is however another issue now with the build from personal computer: Extensions do not show. They can be downloaded and installed by restoring from previous, but they don’t show. I’m not sure wether this is related or not. Here is the log:

[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Session start time .......: 2022-05-23 11:26:53
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Slicer version ...........: 5.0.2-2022-05-06 (revision 30822 / a4420c3) macosx-amd64 - not installed release
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Operating system .........: macOS / 11.2.1 / 20D74 / UTF-8 - 64-bit
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Memory ...................: 16384 MB physical, 0 MB virtual
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - CPU ......................: GenuineIntel Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz, 6 cores, 12 logical processors
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - VTK configuration ........: OpenGL2 rendering, Sequential threading
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Qt configuration .........: version 5.15.1, with SSL, requested OpenGL 3.2 (core profile)
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Internationalization .....: disabled, language=
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Developer mode ...........: enabled
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Application path .........: /Users/simon/bin/Slicer/Slicer-build/bin/Slicer.app/Contents/MacOS
[DEBUG][Qt] 23.05.2022 11:26:53 [] (unknown:0) - Additional module paths ..: (none)
[DEBUG][Python] 23.05.2022 11:26:55 [Python] (/Users/simon/bin/Slicer/Slicer-build/lib/Slicer-5.0/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: Annotations
[DEBUG][Python] 23.05.2022 11:26:55 [Python] (/Users/simon/bin/Slicer/Slicer-build/lib/Slicer-5.0/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentEditor
[DEBUG][Python] 23.05.2022 11:26:55 [Python] (/Users/simon/bin/Slicer/Slicer-build/lib/Slicer-5.0/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentStatistics
[DEBUG][Qt] 23.05.2022 11:26:55 [] (unknown:0) - Switch to module:  "Welcome"
[INFO][Stream] 23.05.2022 11:26:56 [] (unknown:0) - Loading Slicer RC file [/Users/simon/.slicerrc.py]
[CRITICAL][FD] 23.05.2022 11:26:57 [] (unknown:0) - [1185:119051:0523/112657.831671:ERROR:socket_posix.cc(148)] bind() failed: Address already in use (48)
[CRITICAL][FD] 23.05.2022 11:26:57 [] (unknown:0) - [1185:119051:0523/112657.831721:ERROR:devtools_http_handler.cc(299)] Cannot start http server for devtools.
[CRITICAL][FD] 23.05.2022 11:26:58 [] (unknown:0) - [1185:98819:0523/112658.096282:ERROR:gl_context_cgl.cc(118)] Error creating context.
[CRITICAL][FD] 23.05.2022 11:26:58 [] (unknown:0) - [0523/112658.203425:ERROR:icu_util.cc(199)] Couldn't mmap icu data file
[CRITICAL][FD] 23.05.2022 11:26:58 [] (unknown:0) - [0523/112658.203736:ERROR:icu_util.cc(199)] Couldn't mmap icu data file
[CRITICAL][FD] 23.05.2022 11:26:58 [] (unknown:0) - [0523/112658.707508:ERROR:icu_util.cc(199)] Couldn't mmap icu data file
[CRITICAL][FD] 23.05.2022 11:26:58 [] (unknown:0) - [0523/112658.966048:ERROR:icu_util.cc(199)] Couldn't mmap icu data file
[WARNING][Qt] 23.05.2022 11:26:59 [] (unknown:0) - static bool qSlicerExtensionsManagerModelPrivate::validateExtensionMetadata(const qSlicerExtensionsManagerModelPrivate::ExtensionMetadataType &, int)  failed: expected key ' "meta.screenshots" ' is missing from extension metadata.

Would be great if this fix could be incorporated! Thanks a lot for the help!

It appears that patch was backported to the Qt 5.15 maintenance branch (see below). Although there is only tags up to Qt 5.15.2 and this patch came afterwards and was likely included in Qt 5.15.3 based on the date, the GitHub - qt/qtbase at 5.15 branch appears to have many additional fixes for the Qt 5.15 release. This could potentially be used when building from source.

In the Qt install tool the latest available version is Qt-5.15.2. Qt company have already stopped long-term-support for open-source users, so Qt-5.15.3 release is only available for paying users. Free users needs to use latest Qt release to get patches.

@jcfr Do you think we could use commercial license for creating Slicer packages using Qt LTS releases, such as Qt-5.15.3? I’m not sure it is a good idea, just wondering about possible options.

@lassoan Are you not wanting to use latest GitHub - qt/qtbase at 5.15 which includes the patch for macOS because it would be different from the Qt 5.15.2 pre-built binaries downloaded for the Windows platform? We already build Qt from source for macOS Slicer factory builds.

Qt-5.15 is a special case. There are some LGPL LTS tags. There are Commercial LTS versions that are a year ahead of thoseLGPL tags. For example Qt 5.15.4-lts-lgpl was released in May 2022, while Qt 5.15.4 was released in May 2021 (a year earlier). I don’t know if this is a coincidence or if there is an agreement that changes must be made public in 12 months (I remember reading something like this somewhere). There is also KDE’s Qt-5.15 patch collection. We could probably build Qt from one of these sources, which would be inconvenient, but tolerable.

After Qt-5.15 I’m not sure if we can continue what we have been doing, but we have a few options to choose from:

  • using Qt’s official rolling latest release: as we know Qt, these often contain regressions (bugs, missing features whenever there is some refactoring); but it is nice that we don’t need to build Qt form source on Windows and Linux
  • use unofficial LTS-like releases: a chosen Qt version with some important patches applied. We could do this at a very limited scope (merge fixes that users explicitly complain about), but maybe KDE or other project will maintain patch collections for Qt6 that we can use in the future.
  • buy commercial license that gives access to LTS releases: Qt charges a completely unreasonable price for their commercial license, which makes it impossible to buy every developer a license; so this is not really an option

btw, I put the packaged Slicer here, in case someone wants to test it.

1 Like

@jcfr @Sam_Horvath are we using self-built Qt on the factory machine? Could we apply this one-line patch to Qt?