luarocks / luarocks-site

LuaRocks website and module host
http://luarocks.org
175 stars 36 forks source link

Error 500 downloading https://luarocks.org/manifest-5.3.zip #87

Closed hishamhm closed 8 years ago

hishamhm commented 8 years ago

These URLs are failing with Error 500:

They are returning the following error message:

Error

...e/luarocks/.luarocks/share/lua/5.1/lapis/application.lua:668: ./helpers/manifests.lua:129: attempt to index local 'dep' (a nil value)
stack traceback:
    ./helpers/manifests.lua: in function 'build_manifest'
    ./applications/manifest.lua:102: in function <./applications/manifest.lua:54>

Traceback

stack traceback:
    [C]: in function 'error'
    ...e/luarocks/.luarocks/share/lua/5.1/lapis/application.lua:668: in function 'fn'
    ./applications/manifest.lua:34: in function 'fn'
    /home/luarocks/.luarocks/share/lua/5.1/lapis/cache.lua:62: in function 'handler'
    ...e/luarocks/.luarocks/share/lua/5.1/lapis/application.lua:402: in function 'resolve'
    ...e/luarocks/.luarocks/share/lua/5.1/lapis/application.lua:411: in function <...e/luarocks/.luarocks/share/lua/5.1/lapis/application.lua:409>
    [C]: in function 'xpcall'
    ...e/luarocks/.luarocks/share/lua/5.1/lapis/application.lua:409: in function 'dispatch'
    /home/luarocks/.luarocks/share/lua/5.1/lapis/nginx.lua:205: in function </home/luarocks/.luarocks/share/lua/5.1/lapis/nginx.lua:203>

The LuaRocks command-line tool is not failing because this URL keeps working:

But the failure above is causing an extra delay. Here's the output of the relevant parts of luarocks search lapis with fs_use_modules=false set it .luarocks/config.lua:


io.popen:   'pwd' 2> /dev/null

os.execute:     cd '/Users/hisham/luarocks/src' && mkdir -p '/Users/hisham/.cache/luarocks/https___luarocks.org'
Results: 3
  1 (boolean): true
  2 (string): exit
  3 (number): 0

os.execute:     cd '/Users/hisham/luarocks/src' && 'curl' -k -f -L --user-agent 'LuaRocks/scm linux-x86 via curl' --connect-timeout 30 'https://luarocks.org/manifest-5.3.zip' 2> /dev/null 1> '/Users/hisham/.cache/luarocks/https___luarocks.org/manifest-5.3.zip'
Results: 3
  1 (nil): nil
  2 (string): exit
  3 (number): 22

os.execute:     cd '/Users/hisham/luarocks/src' && mkdir -p '/Users/hisham/.cache/luarocks/https___luarocks.org'
Results: 3
  1 (boolean): true
  2 (string): exit
  3 (number): 0

os.execute:     cd '/Users/hisham/luarocks/src' && 'curl' -k -f -L --user-agent 'LuaRocks/scm linux-x86 via curl' --connect-timeout 30 'https://luarocks.org/manifest-5.3' 2> /dev/null 1> '/Users/hisham/.cache/luarocks/https___luarocks.org/manifest-5.3'
Results: 3
  1 (nil): nil
  2 (string): exit
  3 (number): 22

os.execute:     cd '/Users/hisham/luarocks/src' && mkdir -p '/Users/hisham/.cache/luarocks/https___luarocks.org'
Results: 3
  1 (boolean): true
  2 (string): exit
  3 (number): 0

os.execute:     cd '/Users/hisham/luarocks/src' && 'curl' -k -f -L --user-agent 'LuaRocks/scm linux-x86 via curl' --connect-timeout 30 'https://luarocks.org/manifest' 2> /dev/null 1> '/Users/hisham/.cache/luarocks/https___luarocks.org/manifest'
Results: 3
  1 (boolean): true
  2 (string): exit
  3 (number): 0
leafo commented 8 years ago

Fix deployed, looks like there's a rockspec using dependency information that can't be parsed.

hishamhm commented 8 years ago

oh, if you figure out which one it is it will help me fix things to make stricter checks in the tool, so that luarocks upload catches this.

BTW, I was just thinking earlier today: do you have any stats on what % of rock uploads are done via luarocks upload versus the web interface?

hishamhm commented 8 years ago

From my initial look at the code, it seems dependency parse errors should be caught:

upload.runfetch.load_rockspecfetch.load_local_rockspecdeps.parse_dep

   if rockspec.dependencies then
      for i = 1, #rockspec.dependencies do
         local parsed, err = deps.parse_dep(rockspec.dependencies[i])
         if not parsed then
            return nil, "Parse error processing dependency '"..rockspec.dependencies[i].."': "..tostring(err)
         end
         rockspec.dependencies[i] = parsed
      end

So I'm guessing this one was uploaded using the web interface? (or deps.parse_dep is not being strict enough? (or your manifest generator is being too strict?))