Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-6884

Importing a Swagger/OAS Spec using the 3scale Toolbox fails when only '--staging-public-base-url' is set (but not '--production-public-base-url')

    XMLWordPrintable

Details

    • No
    • Hide

      Use the container to attempt importing a spec file:

      # docker container run -it -v /tmp/spec:/tmp/spec registry.redhat.io/3scale-amp2/toolbox-rhel7:3scale2.7 3scale import openapi -k -t system-name -d https://<TOKEN>@<3SCALE BACKEND> --staging-public-base-url=https://<STAGING URL>:443 --default-credentials-userkey=123 /tmp/spec/<FILE>.json
      

      Expected: The Product/Service is created without errors.

      Current Behavior: The Product/Service is created however with the error from the Description. Testing with the image 'toolbox-rhel7:3scale2.9' also prints an error however it's less verbose:

      Traceback (most recent call last):
      	10: from /opt/toolbox/bin/3scale:29:in `<main>'
      	 9: from /opt/toolbox/bin/3scale:29:in `load'
      	 8: from /opt/toolbox/exe/3scale:15:in `<top (required)>'
      	 7: from /opt/toolbox/lib/3scale_toolbox/cli.rb:44:in `run'
      	 6: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:5:in `error_watchdog'
      	 5: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:9:in `error_watchdog'
      	 4: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:13:in `rescue in error_watchdog'
      	 3: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:25:in `handle_error'
      	 2: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:39:in `print_unexpected_error'
      	 1: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:39:in `open'
      /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:39:in `initialize': Permission denied @ rb_sysopen - crash.log (Errno::EACCES)
      
      Show
      Use the container to attempt importing a spec file: # docker container run -it -v /tmp/spec:/tmp/spec registry.redhat.io/3scale-amp2/toolbox-rhel7:3scale2.7 3scale import openapi -k -t system-name -d https: //<TOKEN>@<3SCALE BACKEND> --staging- public -base-url=https://<STAGING URL>:443 -- default -credentials-userkey=123 /tmp/spec/<FILE>.json Expected: The Product/Service is created without errors. Current Behavior: The Product/Service is created however with the error from the Description. Testing with the image 'toolbox-rhel7:3scale2.9' also prints an error however it's less verbose: Traceback (most recent call last): 10: from /opt/toolbox/bin/3scale:29:in `<main>' 9: from /opt/toolbox/bin/3scale:29:in `load' 8: from /opt/toolbox/exe/3scale:15:in `<top (required)>' 7: from /opt/toolbox/lib/3scale_toolbox/cli.rb:44:in `run' 6: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:5:in `error_watchdog' 5: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:9:in `error_watchdog' 4: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:13:in `rescue in error_watchdog' 3: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:25:in `handle_error' 2: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:39:in `print_unexpected_error' 1: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:39:in `open' /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:39:in `initialize': Permission denied @ rb_sysopen - crash.log (Errno::EACCES)

    Description

      When importing a Swagger/OAS Spec to 3scale, if the option 'staging-public-base-url' is specified but not 'production-public-base-url', there is a misleading error about "endpoints":

      ...
      ===== MESSAGE:
      
      KeyError: key not found: "endpoint"
      
      ===== BACKTRACE:
      
      /opt/toolbox/lib/3scale_toolbox/commands/import_command/openapi/create_activedocs_step.rb:56:in `fetch'
      /opt/toolbox/lib/3scale_toolbox/commands/import_command/openapi/create_activedocs_step.rb:56:in `block in rewritten_openapi'
      /opt/toolbox/lib/3scale_toolbox/commands/import_command/openapi/create_activedocs_step.rb:54:in `tap'
      /opt/toolbox/lib/3scale_toolbox/commands/import_command/openapi/create_activedocs_step.rb:54:in `rewritten_openapi'
      /opt/toolbox/lib/3scale_toolbox/commands/import_command/openapi/create_activedocs_step.rb:13:in `call'
      /opt/toolbox/lib/3scale_toolbox/commands/import_command/openapi.rb:59:in `each'
      /opt/toolbox/lib/3scale_toolbox/commands/import_command/openapi.rb:59:in `run'
      /opt/toolbox/vendor/bundle/ruby/2.5.0/gems/cri-2.15.9/lib/cri/command_runner.rb:34:in `call'
      /opt/toolbox/vendor/bundle/ruby/2.5.0/gems/cri-2.15.9/lib/cri/command_dsl.rb:303:in `block in runner'
      /opt/toolbox/vendor/bundle/ruby/2.5.0/gems/cri-2.15.9/lib/cri/command.rb:360:in `run_this'
      /opt/toolbox/vendor/bundle/ruby/2.5.0/gems/cri-2.15.9/lib/cri/command.rb:296:in `run'
      /opt/toolbox/vendor/bundle/ruby/2.5.0/gems/cri-2.15.9/lib/cri/command.rb:314:in `run'
      /opt/toolbox/vendor/bundle/ruby/2.5.0/gems/cri-2.15.9/lib/cri/command.rb:314:in `run'
      /opt/toolbox/lib/3scale_toolbox/cli.rb:43:in `block in run'
      /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:5:in `block in error_watchdog'
      /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:11:in `error_watchdog'
      /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:5:in `error_watchdog'
      /opt/toolbox/lib/3scale_toolbox/cli.rb:40:in `run'
      /opt/toolbox/exe/3scale:15:in `<top (required)>'
      /opt/toolbox/bin/3scale:29:in `load'
      /opt/toolbox/bin/3scale:29:in `<main>'
      Traceback (most recent call last):
      	10: from /opt/toolbox/bin/3scale:29:in `<main>'
      	 9: from /opt/toolbox/bin/3scale:29:in `load'
      	 8: from /opt/toolbox/exe/3scale:15:in `<top (required)>'
      	 7: from /opt/toolbox/lib/3scale_toolbox/cli.rb:40:in `run'
      	 6: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:5:in `error_watchdog'
      	 5: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:9:in `error_watchdog'
      	 4: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:13:in `rescue in error_watchdog'
      	 3: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:26:in `handle_error'
      	 2: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:42:in `print_error'
      	 1: from /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:42:in `open'
      /opt/toolbox/lib/3scale_toolbox/cli/error_handler.rb:42:in `initialize': Permission denied @ rb_sysopen - crash.log (Errno::EACCES)
      

      Support has thought about a few solutions for this issue:

      • Set the Production URL to come from the spec (preferred solution).
      • Use the same as Staging.
      • Print an error stating that both are required.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rhn-support-ekonecsn Estevao Konecsni
            Eguzki Astiz Lezaun Eguzki Astiz Lezaun
            Martin Kudlej Martin Kudlej
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: