bower / registry

The Bower registry
https://registry.bower.io/packages
MIT License
292 stars 66 forks source link

Error while register new package #102

Closed julkue closed 9 years ago

julkue commented 9 years ago

After running the curl command of the README.md I get the following error message:

HTTP/1.1 505 HTTP Version Not Supported
Connection: close
Server: Cowboy
Date: Tue, 28 Oct 2014 09:50:15 GMT
Content-Length: 0
benschwarz commented 9 years ago

Can you please supply the exact curl command?

julkue commented 9 years ago

curl http://bower.herokuapp.com/packages -F 'name=jquery' -F 'url=git://github.com/jquery/jquery.git' performed with this online tool: http://onlinecurl.com/

benschwarz commented 9 years ago

The /packages endpoint is static and simply returns an array of hashes (basically directly from the database).

Furthermore, the endpoint throws an error and spits out a node stack trace.

curl http://bower.herokuapp.com/packages -F "name=jquery"                                                   
TypeError: Parameter 'url' must be a string, not undefined
    at Url.parse (url.js:107:11)
    at Object.urlParse [as parse] (url.js:101:5)
    at module.exports (/app/lib/normalizeURL.js:7:19)
    at exports.create (/app/lib/routes/packages.js:116:15)
    at callbacks (/app/node_modules/express/lib/router/index.js:164:37)
    at param (/app/node_modules/express/lib/router/index.js:138:11)
    at pass (/app/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/app/node_modules/express/lib/router/index.js:173:5)
    at Object.router (/app/node_modules/express/lib/router/index.js:33:10)
    at Object.router (eval at wrapHandle (/app/node_modules/newrelic/lib/instrumentation/connect.js:1:0), <anonymous>:10:19)

:disappointed:

sheerun commented 9 years ago

For some reason curl hangs indefinitely when I execute this query:

curl -v http://bower.herokuapp.com/packages -F 'name=jquery' -F 'url=git://github.com/jquery/jquery.git'
* Hostname was NOT found in DNS cache
*   Trying 107.22.246.182...
* Connected to bower.herokuapp.com (107.22.246.182) port 80 (#0)
> POST /packages HTTP/1.1
> User-Agent: curl/7.37.1
> Host: bower.herokuapp.com
> Accept: */*
> Content-Length: 271
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------2a1591a92f907f1e
>
< HTTP/1.1 100 Continue
sheerun commented 9 years ago

OK, if finishes after ~minute, with error:

< HTTP/1.1 503 Service Unavailable
< Connection: keep-alive
* Server Cowboy is not blacklisted
< Server: Cowboy
< Date: Wed, 29 Oct 2014 10:50:32 GMT
< Content-Length: 484
< Content-Type: text/html; charset=utf-8
< Cache-Control: no-cache, no-store
* HTTP error before end of send, stop sending
<
<!DOCTYPE html>
    <html>
    <head>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <style type="text/css">
        html, body, iframe { margin: 0; padding: 0; height: 100%; }
        iframe { display: block; width: 100%; border: none; }
      </style>
    <title>Application Error</title>
    </head>
    <body>
      <iframe src="//s3.amazonaws.com/heroku_pages/error.html">
        <p>Application Error</p>
      </iframe>
    </body>
* Closing connection 0
    </html>
julkue commented 9 years ago

@sheerun I get a similar error when performing the curl on the console. The error code I've posted before was just the error code from the online tool.

So what is going on here? Can somebody fix this?

benschwarz commented 9 years ago

Shouldn't registering a package be a POST request?

sheerun commented 9 years ago

It sends a POST

benschwarz commented 9 years ago

Ah. -F changes the response to a POST.

sheerun commented 9 years ago

It seems this issue has been resolved.