Project

General

Profile

Actions

Bug #36672

closed

Cannot create repository, Connection reset by peer

Added by Vladimír Bella over 1 year ago. Updated over 1 year ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

I run Foreman 3.6.1 with Katello 4.8.4 on CentOS Stream 8. I cannot create Debian 12 repository:

# hammer --debug repository create \
  --deb-architectures amd64 \
  --deb-releases bookworm \
  --content-type deb \
  --download-concurrency 1 \
  --download-policy 'on_demand' \
  --label Debian_12_bookworm \
  --name 'Debian 12 bookworm' \
  --mirroring-policy 'mirror_content_only' \
  --organization MyOrganisation \
  --product 'Debian 12 bookworm' \
  --publish-via-http true \
  --url http://ftp.sk.debian.org/debian/

[ INFO 2023-08-11T09:21:29 Init] Initialization of Hammer CLI (3.6.0) has started...
[DEBUG 2023-08-11T09:21:29 Init] Running at ruby 2.7.6-p219

...
[ INFO 2023-08-11T09:21:31 HammerCLIKatello::Repository::CreateCommand] Called with options: {"option_unprotected"=>true, "option_content_type"=>"deb", "option_name"=>"Debian 12 bookworm", "option_label"=>"Debian_12_bookworm", "option_url"=>"http://ftp.sk.debian.org/debian/", "option_download_policy"=>"on_demand", "option_download_concurrency"=>1, "option_mirroring_policy"=>"mirror_content_only", "option_deb_releases"=>"bookworm", "option_deb_architectures"=>"amd64", "option_product_name"=>"Debian 12 bookworm", "option_organization_name"=>"MyOrganisation", "option_product_id"=>1}
[ INFO 2023-08-11T09:21:31 API] Server: https://frm01.myorganisation.local
[ INFO 2023-08-11T09:21:31 API] POST /katello/api/repositories
[DEBUG 2023-08-11T09:21:31 API] Params: {
                    "name" => "Debian 12 bookworm",
                   "label" => "Debian_12_bookworm",
              "product_id" => 1,
            "content_type" => "deb",
                     "url" => "http://ftp.sk.debian.org/debian/",
             "unprotected" => true,
         "download_policy" => "on_demand",
    "download_concurrency" => 1,
        "mirroring_policy" => "mirror_content_only",
            "deb_releases" => "bookworm",
       "deb_architectures" => "amd64" 
}
[DEBUG 2023-08-11T09:21:31 API] Headers: {}
[DEBUG 2023-08-11T09:21:31 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[ERROR 2023-08-11T09:21:32 API] 500 Internal Server Error
[DEBUG 2023-08-11T09:21:32 API] {
    "displayMessage" => "Connection reset by peer",
            "errors" => [
        [0] "Connection reset by peer" 
    ]
}
[DEBUG 2023-08-11T09:21:32 Exception] Using exception handler HammerCLIKatello::ExceptionHandler#handle_internal_error
[ERROR 2023-08-11T09:21:32 Exception] Connection reset by peer
Could not create the repository:
  Connection reset by peer
[ERROR 2023-08-11T09:21:32 Exception]

RestClient::InternalServerError (500 Internal Server Error):
    /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/abstract_response.rb:249:in `exception_with_response'
    /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/abstract_response.rb:129:in `return!'
    /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:353:in `block in rest_client_call_block'
    /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:834:in `process_result'
    /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:743:in `block in transmit'
    /usr/share/ruby/net/http.rb:933:in `start'
    /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:727:in `transmit'
    /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:163:in `execute'
    /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:63:in `execute'
    /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/resource.rb:69:in `post'
    /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:327:in `call_client'
    /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:240:in `http_call'
    /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:190:in `call_action'
    /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:185:in `call'
    /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/resource.rb:21:in `call'
    /usr/share/gems/gems/hammer_cli-3.6.0/lib/hammer_cli/apipie/command.rb:53:in `send_request'
    /usr/share/gems/gems/hammer_cli_foreman-3.6.0/lib/hammer_cli_foreman/commands.rb:180:in `send_request'
    /usr/share/gems/gems/hammer_cli-3.6.0/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /usr/share/gems/gems/hammer_cli-3.6.0/lib/hammer_cli/abstract.rb:103:in `run'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /usr/share/gems/gems/hammer_cli-3.6.0/lib/hammer_cli/abstract.rb:103:in `run'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /usr/share/gems/gems/hammer_cli-3.6.0/lib/hammer_cli/abstract.rb:103:in `run'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    /usr/share/gems/gems/hammer_cli-3.6.0/bin/hammer:147:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'
Actions #1

Updated by Jeremy Lenz over 1 year ago

  • Status changed from New to Need more information
Actions #2

Updated by William Clark over 1 year ago

Hi Vlad, thanks for the report. Can you capture some additional info to help us diagnose this?

1. `hammer ping` output

2. application logs while reproducing the error (capture debug logs using below steps)

```
hammer admin logging -a -d # enable debug logs, restart services for this to take effect
foreman-tail | tee /tmp/debug-log.out # leave this running while you reproduce the problem in a second terminal
hammer admin logging -a -p # set log level back to production, restart services again for it to take effect
```

Actions #3

Updated by Vladimír Bella over 1 year ago

William Clark wrote:

Hi Vlad, thanks for the report. Can you capture some additional info to help us diagnose this?

Sure. I'm on vacation now, I'll get back in about a week.

Actions #4

Updated by Vladimír Bella over 1 year ago

Sorry for this weird question. My hammer has no "admin" subcommand and I have absolutely no idea how to install it. I have tried scl from https://community.theforeman.org/t/feedback-wanted-hammer-cli-foreman-admin-tool/5431 but it doesn't work - "Unable to get file status /etc/scl/conf/tfm: No such file or directory". I don't know what to write to /etc/scl/conf/tfm file (empty file doesn't work too).

Can you tell me, please, how to install "admin" subcommand to my hammer?

  # hammer --version
  hammer (3.6.0)
   * hammer_cli_foreman (3.6.0)
   * hammer_cli_foreman_ansible (0.5.0)
   * hammer_cli_foreman_discovery (1.1.0)
   * hammer_cli_foreman_openscap (0.1.13)
   * hammer_cli_foreman_remote_execution (unknown version)
   * hammer_cli_foreman_ssh (0.0.3)
   * hammer_cli_foreman_tasks (unknown version)
   * hammer_cli_foreman_templates (0.2.0)
   * hammer_cli_foreman_virt_who_configure (unknown version)
   * hammer_cli_foreman_webhooks (0.0.4)
   * hammer_cli_katello (1.8.3)

  # dnf install -y scl-utils
  # wget https://rubygems.org/downloads/hammer_cli_foreman_admin-1.0.0.gem
  # scl enable tfm "gem install hammer_cli_foreman_admin-1.0.0.gem" 
  Unable to get file status /etc/scl/conf/tfm: No such file or directory

  # touch /etc/scl/conf/tfm # ==> did not help, same error
  # echo "" > /etc/scl/conf/tfm
  # scl enable tfm "gem install hammer_cli_foreman_admin-1.0.0.gem" 
  /var/tmp/sclMdWnkk: line 4: /tfm/enable: No such file or directory
  Building native extensions. This could take a while...
  ERROR:  Error installing hammer_cli_foreman_admin-1.0.0.gem:
          ERROR: Failed to build gem native extension.

      current directory: /usr/local/share/gems/gems/ffi-1.15.5/ext/ffi_c
  /usr/bin/ruby -I /usr/share/rubygems -r ./siteconf20230830-392790-1djjk9h.rb extconf.rb
  mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h

  You might have to install separate package for the ruby development
  environment, ruby-dev or ruby-devel for example.

  extconf failed, exit code 1

  Gem files will remain installed in /usr/local/share/gems/gems/ffi-1.15.5 for inspection.
  Results logged to /usr/local/lib64/gems/ruby/ffi-1.15.5/gem_make.out

  # gem install ruby_dev # ruby-dev doesn't exist
  # scl enable tfm "gem install hammer_cli_foreman_admin-1.0.0.gem" 
  /var/tmp/sclI9oVfW: line 4: /tfm/enable: No such file or directory
  Building native extensions. This could take a while...
  ERROR:  Error installing hammer_cli_foreman_admin-1.0.0.gem:
          ERROR: Failed to build gem native extension.

      current directory: /usr/local/share/gems/gems/ffi-1.15.5/ext/ffi_c
  /usr/bin/ruby -I /usr/share/rubygems -r ./siteconf20230830-393920-1juvd88.rb extconf.rb
  mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h

  You might have to install separate package for the ruby development
  environment, ruby-dev or ruby-devel for example.

  extconf failed, exit code 1

  Gem files will remain installed in /usr/local/share/gems/gems/ffi-1.15.5 for inspection.
  Results logged to /usr/local/lib64/gems/ruby/ffi-1.15.5/gem_make.out

  # gem install hammer_cli_foreman_admin-1.0.0.gem
  Building native extensions. This could take a while...
  ERROR:  Error installing hammer_cli_foreman_admin-1.0.0.gem:
          ERROR: Failed to build gem native extension.

      current directory: /usr/local/share/gems/gems/ffi-1.15.5/ext/ffi_c
  /usr/bin/ruby -I /usr/share/rubygems -r ./siteconf20230830-393982-14fqyk9.rb extconf.rb
  mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h

  You might have to install separate package for the ruby development
  environment, ruby-dev or ruby-devel for example.

  extconf failed, exit code 1

  Gem files will remain installed in /usr/local/share/gems/gems/ffi-1.15.5 for inspection.
  Results logged to /usr/local/lib64/gems/ruby/ffi-1.15.5/gem_make.out

P.S.: As you probably already know, I am not familiar with the ruby environment.

Actions #5

Updated by Quinn James over 1 year ago

Hi Vlad,

Are you able to create this repository through the UI or are both methods broken for you at the moment?

Actions #6

Updated by Vladimír Bella over 1 year ago

Quinn James wrote:

Hi Vlad,

Are you able to create this repository through the UI or are both methods broken for you at the moment?

No. If I try it (Content / Products / Debian 12 bookworm / New repository), I get "Danger alert:Connection reset by peer". I read suggestions on internet and decided to add "--download-concurrency 1" parameter, so I had to move to hammer.

Actions #7

Updated by Chris Roberts over 1 year ago

  • Status changed from Need more information to Closed
  • Triaged changed from No to Yes

Hi Vladimír,

Are you able to open a post at the Foreman Community Discorse at https://community.theforeman.org? That way we can get back to you quicker and we can get more eyes on the issue as well. Also, if you can do `foreman-tail > repocreate` on the CLI, while you are trying to create the repo in the UI. Then upload the contents of that file on Discorse.

Actions #8

Updated by Chris Roberts over 1 year ago

  • Status changed from Closed to Need more information
  • Triaged changed from Yes to No
Actions #9

Updated by Lucy Fu over 1 year ago

No update. Need more information to debug.
Close for now.

Actions #10

Updated by Lucy Fu over 1 year ago

  • Status changed from Need more information to Rejected
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF