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

3scale deployment does not work when "upstream" is used as the AMP version

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 2.5 CR1
    • System
    • None
    • 3
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • 3scale 2019-08-12, 3scale 2019-08-26, 3scale 2019-09-09

      Hi,

      Deploying 3scale I've detected that when AMP_RELEASE is set to "upstream" and you go to the admin console and try to configure APICast the HTTP request returned is internal error.
      What I've done is:
      Login to admin console -> dashboard -> API -> Configure APIcast button

      By looking at the logs of system-master I've seen the following logs:

      [f94f949d-779e-46b9-bd34-04587465a461] [3scale-admin.demo.34.248.218.110.nip.io] [2.139.235.79] Completed 500 Internal Server Error in 71ms (ActiveRecord: 7.0ms)
      Exception -- [f94f949d-779e-46b9-bd34-04587465a461] [3scale-admin.demo.34.248.218.110.nip.io] [2.139.235.79] {:exception=>{:class=>ActionView::Template::Error, :message=>"undefined method `[]' for nil:NilClass", :backtrace=>["/opt/system/app/helpers/application_helper.rb:347:in `major_and_minor_version_path'", "/opt/system/app/helpers/application_helper.rb:352:in `docs_base_url'", "/opt/system/app/views/api/integrations/apicast/configuration_driven/_configuration.html.slim:21:in `block in _app_views_api_integrations_apicast_configuration_driven__configuration_html_slim__3854956743737330953_77350180'", "/opt/system/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.11.1/lib/action_view/helpers/capture_helper.rb:38:in `block in capture'"]}, :parameters=>{}}
      [f94f949d-779e-46b9-bd34-04587465a461] [3scale-admin.demo.34.248.218.110.nip.io] [2.139.235.79] 
      ActionView::Template::Error (undefined method `[]' for nil:NilClass):
          18:         - else
          19:           | Configure & test immediately in the staging environment
          20: 
          21:       =< link_to t('api.integrations.proxy.visit_documentation'), t("api.integrations.proxy.documentation_apicast_url", docs_base_url: docs_base_url), class: 'documentation-link', target: '_blank'
          22: 
          23:     div class=("feedback api #{'success' if @proxy.api_test_success} #{'no-test' if @proxy.api_test_path.blank? or @proxy.api_test_success.nil?}")
          24:       i.fa.fa-puzzle-piece
        app/helpers/application_helper.rb:347:in `major_and_minor_version_path'
        app/helpers/application_helper.rb:352:in `docs_base_url'
        app/views/api/integrations/apicast/configuration_driven/_configuration.html.slim:21:in `block in _app_views_api_integrations_apicast_configuration_driven__configuration_html_slim__3854956743737330953_77350180'
        app/views/api/integrations/apicast/configuration_driven/_configuration.html.slim:1:in `_app_views_api_integrations_apicast_configuration_driven__configuration_html_slim__3854956743737330953_77350180'
        app/views/api/integrations/edit.html.slim:26:in `_app_views_api_integrations_edit_html_slim___1070417509392807360_71608480'
        lib/three_scale/middleware/multitenant.rb:116:in `_call'
        lib/three_scale/middleware/multitenant.rb:111:in `call'
        lib/action_dispatch/rails5_ssl.rb:86:in `call'
      
      2.139.235.79 - - [04/Apr/2019:15:06:28 +0000] "GET /500 HTTP/1.1" 500 - 0.0903
      2.139.235.79 - - [04/Apr/2019:15:06:28 +0000] "GET %2Fassets%2Ferror.css HTTP/1.1" 200 16027 0.0028
      

      The Operator currently uses "upstream" for AMP_RELEASE when upstream images are gathered and not a specific version number because it does not belong to any specific AMP release number.

      mcassola has told me that this is a bug related to a expression.

      This currently breaks the functionality of the Operator when using upstream as the productVersion.

      Dev Notes

      System should accept whatever string is in AMP_RELEASE in order to show it in the UI, but there's a regex in https://github.com/3scale/porta/blob/b10daec6694f902364872360c5cf3889f2861f07/app/helpers/application_helper.rb#L343 that parses the string trying to extract version number out of it. The extracted values are used to build the URL to the docs (also rendered in the UI). We need to fix that regex so a link to the docs can be built despite of AMP_RELEASE sometimes not holding a valid version number.
      Make sure to read this comment

              Unassigned Unassigned
              msorianod Miguel Soriano
              Michal Macejko Michal Macejko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: