Bug 477081 - Plasma 6 proxy configuration bypass PAC files directives
Summary: Plasma 6 proxy configuration bypass PAC files directives
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 23.04.2
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2023-11-16 09:05 UTC by Rafael Linux User
Modified: 2024-05-20 12:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
PAC file directives (542 bytes, text/x-matlab)
2024-05-10 12:40 UTC, Rafael Linux User
Details
Errors showed when trying to access remote folders (4.06 KB, text/plain)
2024-05-10 12:44 UTC, Rafael Linux User
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Linux User 2023-11-16 09:05:18 UTC
SUMMARY
Scenario: Intranet with Internet access via HTTP proxy.
For years I have been using Plasma on a corporate intranet where HTTP authentication is required to access the Internet and Windows domain authentication is required to access shared folders on domain computers, using the SMB protocol. An important detail here is that FTP access is to local servers INSIDE the intranet, not to computers outside, i.e. Internet access is not required for FTP.

For years, it has always worked as follows:
- Configure the system proxy
- Set up the KDE proxy (as you know, they are independent).
The problem with this configuration was that KDE applications, such as Dolphin, when making an FTP connection, would try to use the proxy, so it would eventually fail. The solution I had to find years ago, is to create a PAC file, which only in the KDE proxy. In that file, I put that if the path does NOT contain HTTP://, DO NOT use the proxy. It has always worked without further problems (and I don't know if there is an easier way to do it, which would be wonderful).

However, for a few months now, every time I update the system, Dolphin crashes and is unable to access the local FTP paths (the same happens with Krusader) and I have to recover the previous snapshot to be able to continue working, without being able to update the system. In this regard, I have verified that it happens even with the latest LIVE versions including the latest versions of KDE.


STEPS TO REPRODUCE
1. Update KDE/Plasma
2. Access to internal FTP server thru Dolphin


OBSERVED RESULT
Dolphin shows an unexpected error, can't access to the FTP path. Console shows these messages:
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_get_scheme: assertion 'uri != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_get_scheme: assertion 'uri != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_str_has_prefix: assertion 'str != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_get_scheme: assertion 'uri != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_str_has_prefix: assertion 'str != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_get_scheme: assertion 'uri != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_str_has_prefix: assertion 'str != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_to_string: assertion 'uri != NULL' failed

EXPECTED RESULT
To access FTP server.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20230613
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.9
Kernel Version: 6.3.7-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-9700K CPU @ 3.60GHz


ADDITIONAL INFORMATION
Usually, "caja" file admin continue working after update
Comment 1 Méven Car 2024-05-08 17:23:01 UTC
> Dolphin crashes and is unable to access the local FTP paths (the same happens with Krusader

Please provide a crash trace, that will be extremely useful to find the issue origin.
There should be a drkonqi notification to help you do that.

Otherwise you can follow you distro steps https://en.opensuse.org/openSUSE:Bugreport_application_crashed#Install_-debuginfo_Packages

The issue is more likely to be in KIO  Framework that handles the ftp implementation.

> KDE Plasma Version: 5.27.5
> KDE Frameworks Version: 5.107.0

If you have the chance to test with a live iso with Plasma 6, that would be interesting.
Comment 2 Rafael Linux User 2024-05-10 12:38:14 UTC
I have again done a more extensive test on this, which is why I have changed the title of this thread. 
We started from a pre-Plasma 6 version of Tumbleweed where accessing folders on intranet servers with the FTP, FISH and SMB protocols (on a Windows domain) worked fine on an intranet with an HTTP proxy that requires a username and password.
After upgrading to any version of Plasma 6, none of the protocols work. I noticed that Dolphin, on the first attempt to access an FTP service after upgrading, asked for the proxy username and password, when in fact it should NOT ask for that information after parsing the request if it uses the PAC file. In other words, Plasma is now ignoring the directives in the PAC file (attached).

I launched Dolphin from console, and attached here error showed while trying to reach any of the servers folders using FTP, FISH or SMB.
Comment 3 Rafael Linux User 2024-05-10 12:40:16 UTC
Created attachment 169361 [details]
PAC file directives

Basically, the PAC file says "only use proxy for http protocol" (so no for FTP, FISH or SMB)
Comment 4 Rafael Linux User 2024-05-10 12:44:02 UTC
Created attachment 169362 [details]
Errors showed when trying to access remote folders
Comment 5 Rafael Linux User 2024-05-10 12:47:54 UTC
I don't attach a "crash" file cause basically Dolphin doesn't crash, simply doesn't work like before upgrading.
Comment 6 Nicolas Fella 2024-05-15 06:21:14 UTC
> Dolphin shows an unexpected error, can't access to the FTP path. Console shows these messages:
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_get_scheme: assertion 'uri != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_get_scheme: assertion 'uri != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_str_has_prefix: assertion 'str != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_get_scheme: assertion 'uri != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_str_has_prefix: assertion 'str != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_get_scheme: assertion 'uri != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_str_has_prefix: assertion 'str != NULL' failed
(process:13253): GLib-CRITICAL **: 15:12:52.440: g_uri_to_string: assertion 'uri != NULL' failed

This looks like libproxy is crashing, so there's a bug in libproxy and/or your configuration is not valid.
Comment 7 Rafael Linux User 2024-05-15 21:25:33 UTC
IMHO, I think we can rule out my system configuration, since they are two different computers, on the same network, and that configuration I've been using for years only fails when I update KDE.
Comment 8 Rafael Linux User 2024-05-17 10:23:25 UTC
I found some related issue at https://codereview.qt-project.org/c/qt/qtbase/+/494754

And I warned about this issue in 2021 ... no one ask about. No priority, I guess. https://bugs.kde.org/show_bug.cgi?id=445272

Even I wrote in another thread about with or without using PAC files, when trying to download plasmoids, new themes or any other “downloadable” (I suspect using FTP protocol) packages from Plasma settings menus, it simply fails, cause maybe Plasma try to access to proxy without authentication (and it’s required).
Comment 9 Nicolas Fella 2024-05-19 15:33:46 UTC
Can you attach your .config/kioslaverc file?
Comment 10 Rafael Linux User 2024-05-20 08:21:21 UTC
(In reply to Nicolas Fella from comment #9)
> Can you attach your .config/kioslaverc file?

Of course. I changed to publish here user/domain and path to PAC file for privacy, but they are correct.

AutoResume=true
ConnectTimeout=20
MarkPartial=true
ProxyConnectTimeout=10
ProxyUrlDisplayFlags=3
ReadTimeout=15
ResponseTimeout=600

[Browser Settings/SMBro]
Password=0H@0GA0H@0AO0I50F>0F>0F:0F=
User=1234@intranet

[Proxy Settings]
NoProxyFor=NO_PROXY
Proxy Config Script=/home/myuser/proxy_PAC_configuracion.pac
ProxyType=2
ReversedException=false
ftpProxy=
httpProxy=http_proxy
httpsProxy=https_proxy
socksProxy=

-----------------
Now that I see this file content, I should add that every time I access an SMB folder in the domain, it forces me to type the user as "1234@intranet", although by default only "1234" appears in the user/password window that appears when trying to access a shared SMB folder. A couple of years ago, that wasn't the case. There was no need to enter the domain. Since some change, it forces me to try "1234@intranet" or "intranet\1234".

If you need more info, please, tell it to me.
Comment 11 Nicolas Fella 2024-05-20 11:13:03 UTC
What happens when you replace /home/myuser/proxy_PAC_configuracion.pac with file:///home/myuser/proxy_PAC_configuracion.pac in the UI (or the config file directly)?
Comment 12 Rafael Linux User 2024-05-20 12:23:43 UTC
Before answering the result of the test you ask me, I have verified what is different between the "kioslaverc" files in a "Plasma pre-6" installation (to call it somehow) and "Plasma 6" (I don't know if it is a certain time or a certain version of Plasma 6 when the problem appears).
In that file, there are only two lines that change:
ProxyConnectTimeout=10 (line that doesn't appear in Plasma pre-6)
ftpProxy=NO_PROXY

About ftpProxy value, seems no difference of using NO_PROXY value or not.
In Plasma pre-6, value is EMPTY and works.  In Plasma 6, default value is NO_PROXY.
In Plasma 6, if value is EMPTY then Dolphin shows "Can't connect to host 10.162.0.46: Invalid proxy type for this operaton" when trying reach FTP (I insist, local FTP servers in our intranet) and Dolphin shows "Canceled" when trying to access remote FTP.

Regarding changing the value of "Proxy Config Script", there has been no success after changing the value, logging out and logging back in. Dolphin still behaves the same. Moreover, if I make the change in the Plasma proxy configurator, apply the changes, and open the Plasma proxy configurator again, it doesn't save the change!!! (it probably doesn't recognise the "file" URL as correct). 
Also, I was surprised that if I make the change in the "kioslaverc" file as I had to do because of the problem I just mentioned, and I open the Plasma proxy configurator, it still shows the correct path "/home/...". !!. It is as if that file is not the one that modifies the Plasma proxy configurator.

In any case, after modifying it by hand, logging out, etc, nothing has changed, the problem is still the same.