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

Build fails with "Failed downloading https://rocks.moonscript.org/manifest" (~/.cache/luarocks owned by root user) #1170

Closed
blueyed opened this issue Sep 13, 2014 · 19 comments
Labels
build building and installing Neovim using the provided scripts

Comments

@blueyed
Copy link
Contributor

blueyed commented Sep 13, 2014

I've just tried building Neovim on Ubuntu, and it failed:

make[3]: Entering directory `…/neovim/.deps/build/third-party'
[ 94%] Generating …/neovim/.deps/usr/bin/busted
Warning: Failed searching manifest: Failed fetching manifest for https://rocks.moonscript.org - Failed downloading https://rocks.moonscript.org/manifest
Warning: Failed searching manifest: Failed creating temporary cache directory /home/user/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master_
Warning: Failed searching manifest: Failed creating temporary cache directory /home/user/.cache/luarocks/http___luafr.org_moonrocks_
Warning: Failed searching manifest: Failed creating temporary cache directory /home/user/.cache/luarocks/http___luarocks.logiceditor.com_rocks

Error: Could not find a result named busted 2.0.rc3.
make[3]: *** […/neovim/.deps/usr/bin/busted] Error 1
make[3]: Leaving directory `…/neovim/.deps/build/third-party'
make[2]: *** [CMakeFiles/busted.dir/all] Error 2
make[2]: Leaving directory `…/neovim/.deps/build/third-party'
make[1]: *** [all] Error 2
make[1]: Leaving directory `…/neovim/.deps/build/third-party'
make: *** [deps] Error 2

Accessing the manifest with curl fails like this:

% curl https://rocks.moonscript.org/manifest
curl: (60) SSL certificate problem: unable to get local issuer certificate

Is this a temporary problem?
Accessing the URL using Firefox works.

I have left a comment about this at luarocks/luarocks-site#18 (comment).

@justinmk
Copy link
Member

First time I've seen this issue. I just ran rm -rf build .deps && make on ubuntu without a problem.

Have you customized your curl/SSL configuration at all? I use stock ubuntu, so I don't know why the problem would only be present for you, but maybe you need to add a CA root? http://stackoverflow.com/q/24611640/152142

Accessing the URL using Firefox works.

I assume that means Firefox says the cert is verified by a CA?

@justinmk justinmk added the build building and installing Neovim using the provided scripts label Sep 13, 2014
@fwalch
Copy link
Member

fwalch commented Sep 13, 2014

I have the same issue when running curl (or another tool, e.g. wget), but building nevertheless works. From the build output:

Using https://rocks.moonscript.org/say-1.2-1.src.rock... switching to 'build' mode
Updating manifest for /home/florian/Projects/neovim/.deps/usr/lib/luarocks/rocks
say 1.2-1 is now built and installed in /home/florian/Projects/neovim/.deps/usr (license: MIT <http://opensource.org/licenses/MIT>)

Trying manually, however:

$ curl https://rocks.moonscript.org/say-1.2-1.src.rock
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

I don't know how this is downloaded during the build process, but it works on my system despite the SSL error. Maybe the problem is something else?

@justinmk
Copy link
Member

I'm 95% sure it's because luarocks falls back to curl if its preferred method isn't available.

@justinmk
Copy link
Member

Actually, luarocks sends -k to curl which skips SSL cert validation (awkward silence...):

https://github.com/keplerproject/luarocks/blob/3abde0dc4f1c3a246026d01e871ca9d4c165c57d/src/luarocks/fs/unix/tools.lua#L265

So the fact that curl https://rocks.moonscript.org/manifest fails is a red herring. @blueyed's issue is the same old intermittent problem with luarocks (and apparently moonrocks) servers. Edit: Luarocks already falls back to a GH mirror if needed: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master

@fwalch
Copy link
Member

fwalch commented Sep 13, 2014

We may need to add our lua dependencies to our deps repo, because these luarocks issues are getting ridiculous.

You mean setting up a luarocks repository?

@justinmk
Copy link
Member

@fwalch Yeah I guess. Luarocks allows us to configure alternative sources, and I think creating a repository is just a matter of setting up (yet another 😁) GH pages site, or possibly just a repo. Not really something I'm looking forward to, though. Update: Luarocks already falls back to a GH mirror if needed: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master

@blueyed
Copy link
Contributor Author

blueyed commented Sep 13, 2014

@justinmk
Still the same after rm -rf build .deps.

I've thrown some print statement into /usr/local/share/lua/5.2/luarocks/fs/unix/tools.lua, but it does not show up.

What does [ 94%] Generating /home/daniel/Vcs/neovim/.deps/usr/bin/busted actually do?

@justinmk
Copy link
Member

Generating /home/daniel/Vcs/neovim/.deps/usr/bin/busted is probably just copying the busted bootstrap script to the bin/ directory. But cmake hides a bunch of other steps (even with VERBOSE=1) and I haven't found a good way to get it to log everything (if someone knows, please do tell).

@jszakmeister
Copy link
Contributor

But cmake hides a bunch of other steps (even with VERBOSE=1) and I haven't found a good way to get it to log everything (if someone knows, please do tell).

It's probably not CMake hiding those steps. The build of the dependencies themselves are do using GNU Make. It's simply running a command line. You might need to add something to an individual build command, if you want to see where it's failing. What that is varies by project though.

@jszakmeister
Copy link
Contributor

What does [ 94%] Generating /home/daniel/Vcs/neovim/.deps/usr/bin/busted actually do?

It's running the external build to install Busted. ${DEPS_BIN_DIR}/busted in the artifact that is to be produced by the custom command, so that's why you see the line above. It's running:

${DEPS_BIN_DIR}/luarocks build busted 2.0.rc3 \
    CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}

to produce it, as seen on line 164 of third-party/CMakeLists.txt

@justinmk
Copy link
Member

@jszakmeister thanks for clarification.

@justinmk
Copy link
Member

@blueyed Does curl -k https://rocks.moonscript.org/manifest (notice the -k) work?

@blueyed
Copy link
Contributor Author

blueyed commented Sep 15, 2014

@justinmk
Yes, using -k works of course.

@jszakmeister
Thanks for your info.

Running it directly fails the same: .deps/usr/bin/luarocks build busted 2.0.rc3

Adding --verbose results in:

% .deps/usr/bin/luarocks --verbose build busted 2.0.rc3

os.execute:     'curl' -f -k -L --user-agent 'LuaRocks/2.2.0 linux-x86_64 via curl' --connect-timeout 30 'https://rocks.moonscript.org/manifest-5.1.zip' 2> /dev/null 1> '/home/user/.cache/luarocks/https___rocks.moonscript.org/manifest-5.1.zip'
Results: 1
  1 (number): 512

os.execute:     'curl' -f -k -L --user-agent 'LuaRocks/2.2.0 linux-x86_64 via curl' --connect-timeout 30 'https://rocks.moonscript.org/manifest-5.1' 2> /dev/null 1> '/home/user/.cache/luarocks/https___rocks.moonscript.org/manifest-5.1'
Results: 1
  1 (number): 512

os.execute:     'curl' -f -k -L --user-agent 'LuaRocks/2.2.0 linux-x86_64 via curl' --connect-timeout 30 'https://rocks.moonscript.org/manifest' 2> /dev/null 1> '/home/user/.cache/luarocks/https___rocks.moonscript.org/manifest'
Results: 1
  1 (number): 512
Warning: Failed searching manifest: Failed fetching manifest for https://rocks.moonscript.org - Failed downloading https://rocks.moonscript.org/manifest
Warning: Failed searching manifest: Failed creating temporary cache directory /home/user/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master_
Warning: Failed searching manifest: Failed creating temporary cache directory /home/user/.cache/luarocks/http___luafr.org_moonrocks_
Warning: Failed searching manifest: Failed creating temporary cache directory /home/user/.cache/luarocks/http___luarocks.logiceditor.com_rocks

Error: Could not find a result named busted 2.0.rc3.

Running curl -f -k -L --user-agent 'LuaRocks/2.2.0 linux-x86_64 via curl' --connect-timeout 30 'https://rocks.moonscript.org/manifest-5.1' 1> '/home/user/.cache/luarocks/https___rocks.moonscript.org/manifest-5.1' (without dumping stderr) results in:

zsh: permission denied: /home/user/.cache/luarocks/https___rocks.moonscript.org/manifest-5.1, which is caused by~/.cache/luarocksbeing owned by the root user, probably from having runsudo luarocks` before.

Fixing this by removing ~/.cache/luarocks fixes this build issue.

I think luarocks should maybe handle sudo usage better, and it should not redirect stderr to /dev/null, which would have made it easier to figure out what's wrong.

@blueyed blueyed changed the title build fails with "Failed downloading https://rocks.moonscript.org/manifest" Build fails with "Failed downloading https://rocks.moonscript.org/manifest" (~/.cache/luarocks owned by root user) Sep 15, 2014
@justinmk
Copy link
Member

@blueyed I started to make a bug report for luarocks, but then I noticed in your post that .deps/usr/bin/luarocks --verbose build busted 2.0.rc3 gave us a reasonably precise error:

Warning: Failed searching manifest: Failed creating temporary cache directory /home/user/.cache/luarocks/http___luafr.org_moonrocks_

Maybe we should just remember to look out for that kind of message next time.

@blueyed
Copy link
Contributor Author

blueyed commented Sep 17, 2014

Thanks @justinmk!

I am closing this issue, which has been solved for me.

@blueyed blueyed closed this as completed Sep 17, 2014
@justinmk
Copy link
Member

@blueyed By the way, what's your umask? I am thinking of adding some sanity checks to the Makefile for these kinds of issues.

@blueyed
Copy link
Contributor Author

blueyed commented Sep 17, 2014

@justinmk
My user's umask is 002, but after sudo -i it's 022.

But the error resulted from ~/.cache/luarocks being owned by root, probably because I've used it with sudo sometimes / in the beginning.

The neovim build process could use a separate cache directory for luarocks maybe?

@hishamhm
Copy link

@justinmk if the moonrocks server is misbehaving and you want to fetch files from github, you can configure LuaRocks to use the github mirror of moonrocks by default: https://github.com/keplerproject/luarocks/blob/master/src/luarocks/cfg.lua#L218-L221 — however, latest LuaRocks should be falling back to the next entry in the mirror list if moonrocks fails for any reason...

@justinmk
Copy link
Member

@hishamhm Thanks, very good to know about that GitHub mirror! FYI, this specific issue wasn't a problem with the mirror list fallback, but rather a permissions issue with ~/.cache/luarocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build building and installing Neovim using the provided scripts
Projects
None yet
Development

No branches or pull requests

5 participants