Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Failed searching manifest: Failed fetching manifest - Failed downloading manifest #952

Open
jensenr30 opened this issue Dec 25, 2018 · 25 comments

Comments

@jensenr30
Copy link

jensenr30 commented Dec 25, 2018

I followed the instructions to install luarocks on Windows 7, but I cannot install any rocks. It seems that luarocks is incapable of downloading the manifest.
I have successfully manually visited the manifest page. My web browser is capable of downloading the manifest and displaying it to me.

Does anyone know how this failure occurs?

command line log:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>luarocks install graph-toolkit

Warning: Failed searching manifest: Failed fetching manifest for https://luarocks.org - Failed downloading https://luarocks.org/manifest - C:\Users\jen\AppData\Local/LuaRocks/Cache/https___luarocks.org/manifest
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ - Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest - C:\Users\jen\AppData\Local/LuaRocks/Cache/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master_/manifest
Warning: Failed searching manifest: Failed fetching manifest for http://luafr.org/moonrocks/ - Failed downloading http://luafr.org/moonrocks/manifest - C:\Users\jen\AppData\Local/LuaRocks/Cache/http___luafr.org_moonrocks_/manifest
Warning: Failed searching manifest: Failed fetching manifest for http://luarocks.logiceditor.com/rocks - Failed downloading http://luarocks.logiceditor.com/rocks/manifest - C:\Users\jen\AppData\Local/LuaRocks/Cache/http___luarocks.logiceditor.com_rocks/manifest

Error: No results matching query were found.

C:\Windows\system32>
@maxdevjs
Copy link

maxdevjs commented Dec 25, 2018

Same on Linux. First time I install luarocks, then I can not say if it worked before.

LuaRocks version: 3.0.4-1
Lua version: 5.3.4
$ ./configure --lua-version=5.3 --prefix=$HOME/.luarocks
$ make bootstrap
$ which luarocks
$HOME/.luarocks/bin/luarocks
$ luarocks install dkjosn 
Warning: Failed searching manifest: Failed fetching manifest for https://luarocks.org - Failed downloading https://luarocks.org/manifest - $HOME/.cache/luarocks/https___luarocks.org/manifest
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ - Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest - $HOME/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master_/manifest
Warning: Failed searching manifest: Failed fetching manifest for http://luafr.org/moonrocks/ - Failed downloading http://luafr.org/moonrocks/manifest - $HOME/.cache/luarocks/http___luafr.org_moonrocks_/manifest
Warning: Failed searching manifest: Failed fetching manifest for http://luarocks.logiceditor.com/rocks - Failed downloading http://luarocks.logiceditor.com/rocks/manifest - $HOME/.cache/luarocks/http___luarocks.logiceditor.com_rocks/manifest

Error: No results matching query were found.

I can load manifest URLS in browser.

It also fails a search, example:

$ luarocks search dkjosn 

Warning: Failed searching manifest: Failed fetching manifest for https://luarocks.org - Failed downloading https://luarocks.org/manifest - ...

dkjosn - Search results for Lua 5.3:
====================================

               

@maxdevjs
Copy link

maxdevjs commented Dec 26, 2018

Installing with ./configure --lua-version=5.3 --prefix=$HOME/.luarocks

Tried and failed:

luarocks install --server=http://luarocks.org lgi

Happens also cloning the repo. Furthermore:

$ luarocks install --verbose

...
os.execute:     cd '$HOME/' && test '-e' '$HOME/./../../../../../../../../../.luarocks-no-project'
Results: 3
  1 (nil): nil
  2 (string): exit
  3 (number): 1

io.popen:       stat -c '%U' '$HOME/.cache/luarocks' 2> /dev/null

Error: Argument missing. See '$HOME/.luarocks/lib/luarocks/rocks-5.3/luarocks/dev-1/bin/luarocks help install'.
...

$ $HOME/.luarocks/lib/luarocks/rocks-5.3/luarocks/dev-1/bin/luarocks help install
lua: error loading module 'luarocks.core.cfg' from file '$HOME/.luarocks':
        cannot read $HOME/.luarocks: Is a directory
stack traceback:
        [C]: in ?
        [C]: in function 'require'
        ...rocks/lib/luarocks/rocks-5.3/luarocks/dev-1/bin/luarocks:4: in main chunk
        [C]: in ?

@vincentkerdraon
Copy link

Hello,
same here in Docker

FROM alpine

COPY po_vault.lua validate-po.bash ./

RUN apk add --no-cache --purge -uU lua lua-dev git  \
    && apk add --no-cache --virtual .build-deps build-base unzip \
    && cd /tmp \
    && git clone https://github.com/keplerproject/luarocks.git \
    && cd luarocks \
    && sh ./configure \
    && make build install \
    # && luarocks install luafilesystem \
    && cd \
    && apk del --purge .build-deps \
    && rm -rf /var/cache/apk/* /tmp/* 
luarocks init
Initializing project translations ...
Warning: Please specify supported Lua versions with --lua-versions=<ver>. See '/usr/local/bin/luarocks help write_rockspec'.

Wrote template at /translations/translations-dev-1.rockspec -- you should now edit and finish it.

Checking your Lua installation ...
Adding entries to .gitignore ...

Error: LuaRocks dev bug (please report at https://github.com/luarocks/luarocks/issues).
Arch.: unknown
/usr/local/share/lua/5.1/luarocks/cmd/init.lua:46: attempt to index local 'fd' (a nil value)
stack traceback:
	/usr/local/share/lua/5.1/luarocks/cmd/init.lua:46: in function 'write_gitignore'
	/usr/local/share/lua/5.1/luarocks/cmd/init.lua:86: in function </usr/local/share/lua/5.1/luarocks/cmd/init.lua:54>
	(tail call): ?
	[C]: in function 'xpcall'
	/usr/local/share/lua/5.1/luarocks/cmd.lua:488: in function 'run_command'
	/usr/local/bin/luarocks:38: in main chunk
	[C]: ?
luarocks install luasocket
Warning: Failed searching manifest: Failed fetching manifest for https://luarocks.org - Failed downloading https://luarocks.org/manifest - /root/.cache/luarocks/https___luarocks.org/manifest
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ - Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest - /root/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master_/manifest
Warning: Failed searching manifest: Failed fetching manifest for http://luafr.org/moonrocks/ - Failed downloading http://luafr.org/moonrocks/manifest - /root/.cache/luarocks/http___luafr.org_moonrocks_/manifest
Warning: Failed searching manifest: Failed fetching manifest for http://luarocks.logiceditor.com/rocks - Failed downloading http://luarocks.logiceditor.com/rocks/manifest - /root/.cache/luarocks/http___luarocks.logiceditor.com_rocks/manifest

Error: No results matching query were found.

no change if I delete /root/.cache/luarocks

thank you.

hishamhm added a commit that referenced this issue Mar 15, 2019
Containers often run things from the root directory.
This makes the <name> argument mandatory when running
`luarocks init` from `/`.

See #952 (comment)
hishamhm added a commit that referenced this issue Mar 15, 2019
Avoid reporting itself via the true path of the script; use
the wrapper instead. That is, instead of

```
Error: Argument missing. See '$HOME/.luarocks/lib/luarocks/rocks-5.3/luarocks/dev-1/bin/luarocks help install'.
```

report

```
Error: Argument missing. See '$HOME/.luarocks/bin/luarocks help install'.
```

See #952 (comment)
@phil294
Copy link

phil294 commented Oct 26, 2019

@vincentkerdraon You need to add the curl package manually beforehand.

@sufezyh
Copy link

sufezyh commented Feb 25, 2020

Still no luck.
I'm on windows 7 with curl installed
I've got no idea why I can't do a simple download
And I'm using the latest version of luarocks

@jiajunhua
Copy link

macOS 10.15.6 is also the same problem

@matu3ba
Copy link

matu3ba commented Feb 7, 2021

Arch Linux: problem could be fixed. EDIT: Problems were wrong permissions due to default settings of a sandboxing solution (firejail).

@rivalak
Copy link

rivalak commented Mar 8, 2021

@vincentkerdraon You need to add the curl package manually beforehand.

What is this really mean? I am newer to Lua.

@Wistral
Copy link

Wistral commented Mar 31, 2021

I successfully fix this by setting environment var, maybe help for others.

export https_proxy=192.168.31.45:12333
export http_proxy=192.168.31.45:12333

192.168.31.45:12333 is your proxy host:port

@phil294
Copy link

phil294 commented Mar 31, 2021

@vincentkerdraon You need to add the curl package manually beforehand.

What is this really mean? I am newer to Lua.

It means that you might need to install curl on your operating system (for example, Ubuntu Linux: command sudo apt-get install curl). It has nothing to do with lua itself.
But this may be specific to Alpine Docker images, I'm not sure if this is a general requirement

@Zalgo2462
Copy link

Zalgo2462 commented Apr 23, 2022

I hit this issue when running luarocks on alpine linux. Alpine linux includes a wget implementation via BusyBox, but the BusyBox implementation does not support the flags luarocks passes to it. Even though I had curl installed, luarocks kept trying to use the BusyBox wget implementation. In order to resolve this issue, I had to install the full featured version of wget.

Edit: see the implementation at

if downloader == "wget" then
and
{ var = "WGET", name = "wget" },
.

@alerque
Copy link
Contributor

alerque commented Apr 23, 2022

Given that the wget usage is a fallback anyway, it seems like adjusting luarocks uasge so that it uses the minimum flags possible and is compatible with the busybox implementation might be a good move.

@hishamhm
Copy link
Member

Given that the wget usage is a fallback anyway, it seems like adjusting luarocks uasge so that it uses the minimum flags possible and is compatible with the busybox implementation might be a good move.

We'd end up restricted to whatever limitations a third-party reimplementation of the tool we're trying to use decided to impose; we're using those flags for practical reasons. I've put the effort to make LuaRocks flexible enough to use GNU Wget, Curl and LuaSocket and three backends it's already enough...

On another note, most of the failures reported in this PR look totally unrelated. What I think we should actually do is to start always building LuaRocks as a binary bundling LuaSocket and stop using third-party CLI tools altogether, but that would require a non-trivial effort in reworking our build process (the current process for building LuaRocks binaries is not designed to bootstrap on a system from scratch).

@Zalgo2462
Copy link

Zalgo2462 commented Apr 25, 2022

Given that the wget usage is a fallback anyway

Lua isn't the main language I work in, but it looks like wget is preferred by luarocks over curl.

local tool_options = {
downloader = {
desc = "downloader",
{ var = "WGET", name = "wget" },
{ var = "CURL", name = "curl" },
},
md5checker = {
desc = "MD5 checker",
{ var = "MD5SUM", name = "md5sum" },
{ var = "OPENSSL", name = "openssl", cmdarg = "md5" },
{ var = "MD5", name = "md5" },
},
}
function tools.which_tool(tooltype)
local tool = tool_cache[tooltype]
local names = {}
if not tool then
for _, opt in ipairs(tool_options[tooltype]) do
table.insert(names, opt.name)
if fs.is_tool_available(vars[opt.var], opt.name) then

It appears that the order of preference was changed between versions v3.2.1 and v3.3.0.

Most of the docs out in the world recommend installing curl to fix this issue. Switching the order back may go a long way in preventing more bug reports.


Rather than limiting the flags used, perhaps the code at

else
ok = fs.execute_quiet(tool_cmd, arg)
tool_available_cache[tool_name] = (ok == true)
could check the output from running wget --version to ensure that the version of wget called is GNU wget.

Alternatively, the LuaSocket fix sounds amazing as a user of luarocks. I agree the bug reports seem to stem from different issues related to calling CLI tools that may or may not exist.

@alerque
Copy link
Contributor

alerque commented Apr 25, 2022

The build process for luasocket is likewise a bit convoluted (and not even currently tested on all supported platforms, yikes!) but I'm happy to help facilitate anything that needs to happen to that project's release process if it will make LuaRocks' life easier.

@xuexb
Copy link

xuexb commented Jun 26, 2022

I have the same problem, curl, wget are installed, and both curl https://luarocks.org/manifest-5.1 and curl www.google.com are accessible. The error messages are:

...
os.execute: cd '/var/cache/luarocks/https___luafr.org_luarocks' && wget --no-check-certificate --no-cache --user-agent="LuaRocks/3.9.0 linux-x86_64 via wget" - -quiet --timeout=30 --tries=1 --timestamping 'https://luafr.org/luarocks/manifest-5.1'
wget: unrecognized option: timestamping
BusyBox v1.35.0 (2022-05-09 17:27:12 UTC) multi-call binary.

Usage: wget [-cqS] [--spider] [-O FILE] [-o LOGFILE] [--header STR]
[--post-data STR | --post-file FILE] [-Y on/off]
[-P DIR] [-U AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

--spider Only check URL existence: $? is 0 if exists
--header STR Add STR (of form 'header: value') to headers
--post-data STR Send STR using POST method
--post-file FILE Send FILE using POST method
-c Continue retrieval of aborted transfer
-q Quiet
-P DIR Save to DIR (default .)
-S Show server response
-T SEC Network read timeout is SEC seconds
-O FILE Save to FILE ('-' for stdout)
-o LOGFILE Log messages to FILE
-U STR Use STR for User-Agent header
-Y on/off Use proxy
Results: 1
...

It seems that the wget parameter is wrong?

Environmental Information:

  • alpine 3.16.0
  • Lua 5.1
  • LuaRocks 3.9.0

I found that LuaRocks 3.8.0 is ok.

/tmp/luarocks-3.8.0 # luarocks install luacheck
Installing https://luarocks.org/luacheck-0.26.1-1.src.rock
Missing dependencies for luacheck 0.26.1-1:
   argparse >= 0.6.0 (not installed)
   luafilesystem >= 1.6.3 (not installed)

luacheck 0.26.1-1 depends on lua >= 5.1 (5.1-1 provided by VM)
luacheck 0.26.1-1 depends on argparse >= 0.6.0 (not installed)
Installing https://luarocks.org/argparse-0.7.1-1.src.rock

argparse 0.7.1-1 depends on lua >= 5.1, < 5.5 (5.1-1 provided by VM)
No existing manifest. Attempting to rebuild...
argparse 0.7.1-1 is now installed in /tmp/luarocks-3.8.0/./lua_modules (license: MIT)

luacheck 0.26.1-1 depends on luafilesystem >= 1.6.3 (not installed)
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock

luafilesystem 1.8.0-1 depends on lua >= 5.1 (5.1-1 provided by VM)
gcc -O2 -fPIC -I/usr/include -c src/lfs.c -o src/lfs.o
gcc -shared -o lfs.so src/lfs.o
luafilesystem 1.8.0-1 is now installed in /tmp/luarocks-3.8.0/./lua_modules (license: MIT/X11)

luacheck 0.26.1-1 is now installed in /tmp/luarocks-3.8.0/./lua_modules (license: MIT)

@carnei-ro
Copy link

Indeed wget has precedence over curl and for luarocks >= 3.9 the flag --timestamping is crashing the wget "alpine version"

I'm removing wget as downloader :

sed -i '/WGET/d' /usr/local/share/lua/5.1/luarocks/fs/tools.lua

@imolein
Copy link
Contributor

imolein commented Aug 21, 2022

@carnei-ro I recognized this in my luarocks docker containers just now and find out that it's the busybox version of wget which don't have the option. After running apk add wget it is working.

@alerque
Copy link
Contributor

alerque commented Aug 21, 2022

If it is going to prioritize it above other options luarocks, should probably detect and support the busybox wget and gently downgrade the functionality.

@Tieske
Copy link
Contributor

Tieske commented Aug 22, 2022

ran into this exact issue today as well. Seems like it should indeed detect. Or see if we can do without that --timestamping option

@jianwu
Copy link

jianwu commented Apr 18, 2023

First time to use Lua on my Macbook. Surprised to be blocked by such a basic function. Wasted hours of time to search around, I found it's caused by broken wget installation. After I run brew install wget, the problem solved. Seems this is a common problem, I think if some better error messages will be much helpful.

@adoyle-h
Copy link

I'm using MacOS. Running brew upgrade wget to upgrade wget to version 1.21.3_1 will solve this problem.

@lalawue
Copy link

lalawue commented Jul 9, 2023

using alpine 3.18 under LXD container, I choose to install luarocks from source, it works

  • first install curl, # add curl
  • modify luarocks-3.9.2/luarocks/fs/tools.lua, comment --{ var = "WGET", name = "wget" }, force luarocks using curl
    it works

@lboix
Copy link

lboix commented Jul 13, 2023

@carnei-ro I recognized this in my luarocks docker containers just now and find out that it's the busybox version of wget which don't have the option. After running apk add wget it is working.

I confirm that this adding fixed my pipeline too : https://github.com/sm360/nginx-ingress-controller-with-lua-resty-openidc/blob/main/Dockerfile#L10

Thanks for sharing it 👍

@Anamura
Copy link

Anamura commented Jul 29, 2023

Hi, same here. hello from 2023)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests