Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-9741

invalid npm search results in 404 error page rather than a handled error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-m7
    • Fix Version/s: 3.0.0
    • Component/s: NPM
    • Labels:
      None
    • Environment:
      MacOSX
    • Story Points:
      1
    • Sprint:
      Sprint 62 - Föhn

      Description

      Justin Young noticed in NX3 when you search for an unknown component it returns our 404 html rather than the handled error.

      Example of current:

      npm install asdfasdfasdfasdfasdfasdf
      npm ERR! registry error parsing json
      npm ERR! Darwin 15.0.0
      npm ERR! argv "node" "/usr/local/bin/npm" "install" "asdfasdfasdfasdfasdfasdf"
      npm ERR! node v0.12.4
      npm ERR! npm  v3.5.3
      
      npm ERR! Unexpected token <
      npm ERR! <html>
      npm ERR! <head>
      npm ERR!   <title>404 - Nexus Repository Manager</title>
      npm ERR!   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      npm ERR!
      npm ERR!   <link rel="icon" type="image/png" href="http://127.0.0.1:8081/favicon.png$?3.0.0-SNAPSHOT">
      npm ERR!   <!--[if IE]>
      npm ERR!   <link rel="SHORTCUT ICON" href="http://127.0.0.1:8081/favicon.ico?3.0.0-SNAPSHOT"/>
      npm ERR!   <![endif]-->
      npm ERR!
      npm ERR!   <link rel="stylesheet" type="text/css" href="http://127.0.0.1:8081/static/css/nexus-content.css?3.0.0-SNAPSHOT"/>
      npm ERR! </head>
      npm ERR! <body>
      npm ERR! <div class="nexus-header">
      npm ERR!   <a href="http://127.0.0.1:8081">
      npm ERR!     <img src="http://127.0.0.1:8081/static/images/nexus.png?3.0.0-SNAPSHOT"/>
      npm ERR!     <span class="name">Nexus Repository Manager</span>
      npm ERR!   </a>
      npm ERR!   <span class="version">PRO 3.0.0-SNAPSHOT</span>
      npm ERR! </div>
      npm ERR!
      npm ERR! <div class="nexus-body">
      npm ERR!   <div class="content-header">
      npm ERR!     <img src="http://127.0.0.1:8081/static/rapture/resources/icons/x32/exclamation.png?3.0.0-SNAPSHOT"/>
      npm ERR!     <span class="title">Error 404</span>
      npm ERR!     <span class="description">Not Found</span>
      npm ERR!   </div>
      npm ERR!   <div class="content-body">
      npm ERR!     <div class="content-section">
      npm ERR!       Not Found
      npm ERR!     </div>
      npm ERR!       </div>
      npm ERR! </div>
      npm ERR! </body>
      npm ERR! </html>
      npm ERR!
      npm ERR!
      npm ERR!
      npm ERR! If you need help, you may report this error at:
      npm ERR!     <https://github.com/npm/npm/issues>
      
      npm ERR! Please include the following file with any support request:
      npm ERR!     /Users/null/sonatype/insight-brain/insight-brain-service/npm-debug.log
      

      Example of expected:

      npm install asdfasdfasdfasdfasdfasdf
      npm ERR! Darwin 15.0.0
      npm ERR! argv "node" "/usr/local/bin/npm" "install" "asdfasdfasdfasdfasdfasdf"
      npm ERR! node v0.12.4
      npm ERR! npm  v3.5.3
      npm ERR! code E404
      
      npm ERR! 404 Package '@foo/bar' not found : repository
      npm ERR! 404
      npm ERR! 404  'repository' is not in the npm registry.
      npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
      npm ERR! 404
      npm ERR! 404 Note that you can also install from a
      npm ERR! 404 tarball, folder, http url, or git url.
      
      npm ERR! Please include the following file with any support request:
      npm ERR!     /Users/null/sonatype/insight-brain/insight-brain-service/npm-debug.log
      

      After checks with Tamás Cservenák and Jeffry Hesse, he asked me to file if I saw the same (which I do). I did not back check older versions of NX3, but I recall seeing this for a while and just assumed it was as it was supposed to be. Might be we deployed this way.
      I did not check NX2 at this time.

        Attachments

          Activity

            People

            Assignee:
            alin Alin Dreghiciu
            Reporter:
            jtom Joe Tom
            Last Updated By:
            Peter Lynch Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title