EUDAT-B2STAGE / http-api

RESTful HTTP-API for the B2STAGE service inside the EUDAT project
https://eudat-b2stage.github.io/http-api/
MIT License
7 stars 7 forks source link

rapydo start issue / pip broken #110

Closed alexandrehoarau closed 6 years ago

alexandrehoarau commented 6 years ago

Hello everybody,

I tried to install an new http-api instance on SLES 12 SP1.

Last week I was able to install and lauchn rapido quickly on another server. But with this one, I encountered an issue on "rapydo start" command. I seems the pip package is broken.

Do you have any idea to fix it ?

Log :

Installing collected packages: pip, idna, chardet, urllib3, certifi, requests, pygments, httpie, six, wcwidth, prompt-toolkit, parsimonious, click, http-prompt, pyyaml, colorama, jsoncut, urwid, beeprint, pytz, rapydo-utils Found existing installation: pip 9.0.1 Uninstalling pip-9.0.1: Successfully uninstalled pip-9.0.1 Exception: Traceback (most recent call last): File "/usr/local/lib/python3.6/shutil.py", line 436, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'pip3.6'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 795, in install requirement.commit_uninstall() File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 767, in commit_uninstall self.uninstalled.commit() File "/usr/local/lib/python3.6/site-packages/pip/req/req_uninstall.py", line 142, in commit rmtree(self.save_dir) File "/usr/local/lib/python3.6/site-packages/pip/_vendor/retrying.py", line 49, in wrapped_f return Retrying(*dargs, dkw).call(f, *args, *kw) File "/usr/local/lib/python3.6/site-packages/pip/_vendor/retrying.py", line 212, in call raise attempt.get() File "/usr/local/lib/python3.6/site-packages/pip/_vendor/retrying.py", line 247, in get six.reraise(self.value[0], self.value[1], self.value[2]) File "/usr/local/lib/python3.6/site-packages/pip/_vendor/six.py", line 686, in reraise raise value File "/usr/local/lib/python3.6/site-packages/pip/_vendor/retrying.py", line 200, in call attempt = Attempt(fn(args, kwargs), attempt_number, False) File "/usr/local/lib/python3.6/site-packages/pip/utils/init.py", line 102, in rmtree onerror=rmtree_errorhandler) File "/usr/local/lib/python3.6/shutil.py", line 480, in rmtree _rmtree_safe_fd(fd, path, onerror) File "/usr/local/lib/python3.6/shutil.py", line 418, in _rmtree_safe_fd _rmtree_safe_fd(dirfd, fullname, onerror) File "/usr/local/lib/python3.6/shutil.py", line 418, in _rmtree_safe_fd _rmtree_safe_fd(dirfd, fullname, onerror) File "/usr/local/lib/python3.6/shutil.py", line 418, in _rmtree_safe_fd _rmtree_safe_fd(dirfd, fullname, onerror) File "/usr/local/lib/python3.6/shutil.py", line 438, in _rmtree_safe_fd onerror(os.unlink, fullname, sys.exc_info()) File "/usr/local/lib/python3.6/site-packages/pip/utils/init.py", line 110, in rmtree_errorhandler if os.stat(path).st_mode & stat.S_IREAD: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-n9lztlhr-uninstall/usr/local/bin/pip3.6' 2017-12-05 12:04:01,654 [EXIT controller.compose:112] Failed command execution: (, "The command '/bin/sh -c pip install --upgrade --force-reinstall --no-cache-dir -r requirements.txt' returned a non-zero code: 2")

alexandrehoarau commented 6 years ago

In addition, python3.6 and pip3.6 are available

pdonorio commented 6 years ago

Hello @alexandrehoarau, thanks for sharing this.

I'm unable to test on SLES. Can you tell me what branch are you testing?

Can you check the output of these commands:

which pip
which pip3
which pip3.6

EDIT: nevermind because this problem is inside the docker image building.

It seems to me that this part of your log is the key:

Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/shutil.py", line 436, in _rmtree_safe_fd
os.unlink(name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'pip3.6'

I've never seen this kind of error, but it appears that upgrading pip the binary is removed and that crashes the process.

alexandrehoarau commented 6 years ago

Hi, No problem. which pip : /usr/bin/pip which pip3 : /usr/local/bin/pip3 which pip3.6 : /usr/local/bin/pip3.6 Yes, this is the key part of the log, but all binaries are available. I don't understand why the script try to uninstall pip ?

BR, Alex

pdonorio commented 6 years ago

Sorry, you probably missed my first (important) question:

Can you tell me what branch are you testing?

Also, this strange behaviour should be reproduced to be further investigated. If I can't find a way to install or use SLES would you be willing to share a shell session with me?

Thanks

alexandrehoarau commented 6 years ago

Ah yes, sorry. Master branch --> 0.6.1 Unfortunately, I cannot share you directly a shell session to this server but if you know an web application just to share my screen with you , for sure I will try (teamviewer forbidden in my company) Also, maybe I could pass this step of the rapydo configuration or edit the requirements file ?

Thanks . Alex

pdonorio commented 6 years ago

OK, the branch you are testing is a little bit old.

Would you mind to test the latest development branch 1.0.1?

The commands to try should be the same you already used after checking out the new branch.

alexandrehoarau commented 6 years ago

Ok I will try with this one. Do you have the up to date documentation consistent with this version ? Because I saw that projects file hirerarchy change despite of the same commands

pdonorio commented 6 years ago

I've just updated the related quick start.

We broke a few paths since 0.6.1; then we implemented a rapydo upgrade command, but I fear it will be working properly only starting from 1.0.0. I'd suggest you to start in a new cloned folder, sorry for that.

What you should keep/copy (if you made changed to it) is the project_configuration.yml file, now standing in the project/b2stage folder.

pdonorio commented 6 years ago

I don't understand why the script try to uninstall pip ?

Sorry I missed this question. The script is part of the installation process (or building) on one of the docker images used before starting. It used to be important to update from a very old existing 8.x to 9.x. I see from your log that it's already 9.x the starting point now, so it could be eventually omitted.

More questions if 1.0.1 does not work either:

pdonorio commented 6 years ago

This issue was looked into details with private contact. The new branch works fine, except when we have to reinstall on a previous installation that had problems. It seems that clearing everything is a better option in that case. Also docs should provide FAQs for this situations, but that's a thing for the other dedicated issue.