RedHatSatellite / katello-cleanup

automatically remove content-hosts that seem unsused
GNU General Public License v2.0
4 stars 2 forks source link

Error when connecting to Satellite 6.4 #4

Closed SadFaceSmith closed 4 years ago

SadFaceSmith commented 4 years ago

When connecting to a Satellite 6.4 instance, I receive the following error.

  katello-cleanup git:(master)  ./katello-cleanup -n -U https://sat6-master-01.example.com/api/ -t 300 -u user -p 'password' -o ORG 
Traceback (most recent call last):
        18: from ./katello-cleanup:168:in `<main>'
        17: from ./katello-cleanup:90:in `cleanup'
        16: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:127:in `resource'
        15: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:127:in `new'
        14: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/resource.rb:8:in `initialize'
        13: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:114:in `apidoc'
        12: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:265:in `retrieve_apidoc'
        11: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:307:in `retrieve_apidoc_call'
        10: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:216:in `http_call'
         9: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:285:in `call_client'
         8: from /usr/share/gems/gems/rest-client-2.0.0/lib/restclient/resource.rb:51:in `get'
         7: from /usr/share/gems/gems/rest-client-2.0.0/lib/restclient/request.rb:52:in `execute'
         6: from /usr/share/gems/gems/rest-client-2.0.0/lib/restclient/request.rb:215:in `execute'
         5: from /usr/share/gems/gems/rest-client-2.0.0/lib/restclient/request.rb:766:in `transmit'
         4: from /usr/share/ruby/net/http.rb:920:in `start'
         3: from /usr/share/gems/gems/rest-client-2.0.0/lib/restclient/request.rb:776:in `block in transmit'
         2: from /usr/share/gems/gems/rest-client-2.0.0/lib/restclient/request.rb:860:in `process_result'
         1: from /usr/share/gems/gems/rest-client-2.0.0/lib/restclient/abstract_response.rb:103:in `return!'
/usr/share/gems/gems/rest-client-2.0.0/lib/restclient/abstract_response.rb:223:in `exception_with_response': 404 Not Found (RestClient::NotFound)
        7: from ./katello-cleanup:168:in `<main>'
        6: from ./katello-cleanup:90:in `cleanup'
        5: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:127:in `resource'
        4: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:127:in `new'
        3: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/resource.rb:8:in `initialize'
        2: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:114:in `apidoc'
        1: from /home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:264:in `retrieve_apidoc'
/home/etsmith/.gem/ruby/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:267:in `rescue in retrieve_apidoc': Could not load data from https://sat6-master-01,example.com/api/ (ApipieBindings::DocLoadingError)
 - is your server down?
 - was rake apipie:cache run when using apipie cache? (typical production settings)
SadFaceSmith commented 4 years ago

@evgeni As discussed, I updated apipie-bindings, running into SSL verify error. A config to disable self-signed cert verification would be great!

evgeni commented 4 years ago

@Smithe2413 can you try the patch in https://github.com/RedHatSatellite/katello-cleanup/pull/5 please?

SadFaceSmith commented 4 years ago

@evgeni I'm getting a 404 error with no endpoint on the URL. https://paste.fedoraproject.org/paste/qDPBT2-weig8GJthWvrRzg

With /api at the end I get an apidoc loading error. https://paste.fedoraproject.org/paste/e5IUPXOEZkLS20gbwpNi3A

evgeni commented 4 years ago

so the invocation is definitely without /api, that's what the bindings will add themself.

the error you see is valid, the api endpoint changed :dagger:

Ill post a second patch

evgeni commented 4 years ago

oh, you need to pass the org ID, not the name/label, can you try that?

SadFaceSmith commented 4 years ago

Ah! That did it. Thanks for all the help, it's much appreciated!