Error: bad URI(is not URI?)

Problem:
When I run following command
hammer -v -d repository synchronize --id 3 --source-url http://epel.mirror.digitalpacific.com.au/7/x86_64/

It gives error “Error: bad URI(is not URI?)”
Expected outcome:
repo should start syncing.
Foreman and Proxy versions:
katello 3.8
Foreman and Proxy plugin versions:

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

logs

[ERROR 2018-12-03T16:09:15 API] bad URI(is not URI?): 172.18.2xx.xx:3xxx
[DEBUG 2018-12-03T16:09:15 API] #<URI::InvalidURIError: bad URI(is not URI?): 172.18.2xx.xx:3xxx>
[DEBUG 2018-12-03T16:09:15 Exception] Using exception handler HammerCLIKatello::ExceptionHandler#handle_general_exception
[ERROR 2018-12-03T16:09:15 Exception] Error: bad URI(is not URI?): 172.18.2xx.xx:3xxx
Could not synchronize the repository:
Error: bad URI(is not URI?): 172.18.2xx.xx:3xxx
[ERROR 2018-12-03T16:09:15 Exception]

Looks like you don’t have a schema in your config file (either /etc/hammer/cli.modules.d/foreman.yml or ~/.hammer/cli.modules.d/foreman.yml).

What I suspect you have:

:foreman:
  :host: 172.18.2xx.xx:3xxx

What you should have:

:foreman:
  :host: http://172.18.2xx.xx:3xxx

Hello, I have similar problem on foreman 1.24 RC1. I used foreman-installer with proxy settings to be able to connect to Red Hat repositories. Now hammer ping is not possible to use and I cannot create new version of content view.
hammer ping
Error: bad URI(is not URI?): <proxy_IP>:<Proxy_port> //in output are used IP of my proxy and correct port.
Same in /var/log/messages:
Dec 5 12:19:03 hostname pulp: pulp.server.controllers.repository:ERROR: (9045-61056) PulpDataException: Configuration errors:
Dec 5 12:19:03 hostname pulp: pulp.server.controllers.repository:ERROR: (9045-61056) The configuration parameter <proxy_port> must be set to a positive integer, but is currently set to <>.

I was able to solve pulp error by deleting proxy in /etc/pulp/server/plugins.conf.d/yum_importer.json, after that publishing new content view is progressing.

@jjeffers does this seem related to any of the HTTP proxy work you’ve been involved with?

I’ve seen this error when working on a previous HTTP proxy bug where pulp2 didn’t seem to be reflecting proxy fields after setting HTTP proxy policy to either the global proxy or a specified proxy.

In my testing, where we tried to “unset” the proxy port values for a given repository, pulp2 would reject the update with the same error message. It seems like they have a validation that imposes a positive integer on port values.

According to the discussions I had with the pulp team, they were not planning to fix this in pulp2. We would likely have to create a workaround in the meantime.