Bug 2242710
| Summary: | Incorrect curl parameters causes hp-plugin to fail | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Mikhail <mikhail.v.gavrilov> | ||||
| Component: | hplip | Assignee: | Zdenek Dohnal <zdohnal> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | rawhide | CC: | jridky, om, tkorbar, twaugh, zdohnal | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | hplip-3.23.8-1.fc38 hplip-3.23.8-1.fc37 hplip-3.23.8-1.fc39 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2023-10-12 01:45:13 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Mikhail
2023-10-08 09:54:27 UTC
I debug that is happens here:
diff --git a/installer/pluginhandler.py b/installer/pluginhandler.py
index 56683fb..031ceec 100755
--- a/installer/pluginhandler.py
+++ b/installer/pluginhandler.py
@@ -185,14 +185,19 @@ class PluginHandle(object):
if self.__plugin_conf_file.startswith('file://'):
status, filename = utils.download_from_network(self.__plugin_conf_file, local_conf, True)
else:
- wget = utils.which("wget", True)
- if wget:
- status, output = utils.run("%s --tries=3 --timeout=60 --output-document=%s %s --cache=off" %(wget, local_conf, self.__plugin_conf_file))
+ curl = utils.which("curl", True)
+ if curl:
+ print("curl: {}".format(curl))
+ print("local_conf: {}".format(local_conf))
+ print("self.__plugin_conf_file: {}".format(self.__plugin_conf_file))
+ status, output = utils.run("%s --retry 3 --max-time=10 --output %s %s" %(curl, local_conf, self.__plugin_conf_file))
+ print("status: {}".format(status))
+ print("output: {}".format(output))
if status:
log.error("Plugin download failed with error code = %d" %status)
return status, url, check_sum
else:
- log.error("Please install wget package to download the plugin.")
+ log.error("Please install curl package to download the plugin.")
return status, url, check_sum
except IOError as e:
log.error("I/O Error: %s" % e.strerror)
curl: /usr/bin/curl
local_conf: /tmp/tmpy9c58vqk
self.__plugin_conf_file: http://hplip.sf.net/plugin.conf
< Here is invoked curl >
status: 2
output: curl: option --max-time=10: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
Created attachment 1992949 [details]
screenshot
❯ curl --retry 3 --max-time=10 --output /tmp/tmpy9c58vqk http://hplip.sf.net/plugin.conf curl: option --max-time=10: is unknown curl: try 'curl --help' or 'curl --manual' for more information ❯ ❯ curl --help all | grep time
--connect-timeout <fractional seconds> Maximum time allowed for connection
--expect100-timeout <seconds> How long to wait for 100-continue
--happy-eyeballs-timeout-ms <milliseconds> Time for IPv6 before trying IPv4
--keepalive-time <seconds> Interval time for keepalive probes
-m, --max-time <fractional seconds> Maximum time allowed for transfer
-R, --remote-time Set the remote file's time on the local output
--retry-delay <seconds> Wait time between retries
--retry-max-time <seconds> Retry only within this period
-y, --speed-time <seconds> Trigger 'speed-limit' abort after this time
-z, --time-cond <time> Transfer based on a time condition
--trace-time Add time stamps to trace/verbose output
❯
❯
❯ curl --retry 3 --max-time 10 --output /tmp/tmpy9c58vqk http://hplip.sf.net/plugin.conf
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
And yet another problem is redirection: ❯ /usr/bin/curl http://hplip.sf.net/plugin.conf -v * Trying 104.18.34.154:80... * Connected to hplip.sf.net (104.18.34.154) port 80 > GET /plugin.conf HTTP/1.1 > Host: hplip.sf.net > User-Agent: curl/8.3.0 > Accept: */* > < HTTP/1.1 301 Moved Permanently < Date: Sun, 08 Oct 2023 21:49:17 GMT < Transfer-Encoding: chunked < Connection: keep-alive < Cache-Control: max-age=3600 < Expires: Sun, 08 Oct 2023 22:49:17 GMT < Location: https://hplip.sf.net/plugin.conf < Server: cloudflare < CF-RAY: 813197c5ce9176b5-DME < alt-svc: h3=":443"; ma=86400 < * Connection #0 to host hplip.sf.net left intact For solving this issue we should add "--location" and the final command should look like this: /usr/bin/curl --retry 3 --max-time 10 --output /tmp/tmp1wgn6pqh --location http://hplip.sf.net/plugin.conf I make PR which fix this both issues: https://src.fedoraproject.org/rpms/hplip/pull-request/13 Hi, thank you for the report and the PR! I'm sorry for the problems caused by my downstream patch. I'll push the fix from your colleague and build a new version (there is a new upstream version too) today, but if time is the essence, you can use 'hp-plugin-download' - it downloads and installs the plugin as well. *** Bug 2242723 has been marked as a duplicate of this bug. *** FEDORA-2023-da89e8c661 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-da89e8c661 FEDORA-2023-ac032077c0 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-ac032077c0 FEDORA-2023-f4604b9eb0 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-f4604b9eb0 Zdenek, thanks for reviewing.
Do you know why module base/strings has it's own logging object instance (lines 341-342)?
```
from . import logger
log = logger.Logger('', logger.Logger.LOG_LEVEL_INFO, logger.Logger.LOG_TO_CONSOLE)
```
I wanna remove this instance for use global level logging brodaly.
Without it `log.dedug` in my PR no working even with `-g` option. https://src.fedoraproject.org/rpms/hplip/pull-request/13#_1__16
Are you ok with such change? https://src.fedoraproject.org/fork/mikhail/rpms/hplip/c/4e7529671df8ed31e500f1f3836cc72f4d86f56e?branch=rawhide I tested, for me all working fine. FEDORA-2023-da89e8c661 has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-da89e8c661` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-da89e8c661 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-f4604b9eb0 has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-f4604b9eb0` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-f4604b9eb0 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-ac032077c0 has been pushed to the Fedora 38 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-ac032077c0` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-ac032077c0 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-ac032077c0 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2023-f4604b9eb0 has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report. Zdenek, excuse me for ping. But can you answer me on comment 12 ? https://bugzilla.redhat.com/show_bug.cgi?id=2242710#c12 Or ask upstream why they have several logger instances with different logging level? Hi Mikhail, I'm sorry for the delay - I was working on other things. Upstream does not communicate often, so we won't get answer there - I've looked up into the code and saw there are several calls for 'log', so IMO we should include module g in strings.py, wdyt? But I agree with removing the local logger in strings.py - but we should import the global one IMO, otherwise log. calls will traceback. FEDORA-2023-da89e8c661 has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report. The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |