clone fails with public r/w project
Today I received a public project URL with r/w permissions. I tried to clone locally this project using the client but it fails with:
$) git slatex clone https://.../<id>
DEBUG:git.cmd:Popen(['git', 'init'], cwd=/home/msimonin/workspace/repos/python-sharelatex/6632568886pyyxkvhhtrsz, universal_newlines=False, shell=None, istream=None)
DEBUG:git.cmd:Popen(['git', 'diff', '--abbrev=40', '--full-index', '--raw'], cwd=/home/msimonin/workspace/repos/python-sharelatex/6632568886pyyxkvhhtrsz, universal_newlines=False, shell=None, istream=None)
DEBUG:git.cmd:Popen(['git', 'status', '--porcelain', '--untracked-files'], cwd=/home/msimonin/workspace/repos/python-sharelatex/6632568886pyyxkvhhtrsz, universal_newlines=False, shell=None, istream=None)
DEBUG:root:No option 'username' in section: 'slatex'
Username: msimonin
Password:
Do you want to save your password in your OS keyring system (y/n) ?y
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): login:443
Traceback (most recent call last):
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/util/connection.py", line 57, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/home/msimonin/.pyenv/versions/3.6.5/lib/python3.6/socket.py", line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn
conn.connect()
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/connection.py", line 316, in connect
conn = self._new_conn()
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f1a1db9a320>: Failed to establish a new connection: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1a1db9a320>: Failed to establish a new connection: [Errno -2] Name or service not known',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/msimonin/.pyenv/versions/synchro-git-sharelatex/bin/git-slatex", line 11, in <module>
load_entry_point('sharelatex', 'console_scripts', 'git-slatex')()
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/msimonin/workspace/repos/python-sharelatex/sharelatex/cli.py", line 383, in clone
base_url=base_url, username=username, password=password, verify=https_cert_check
File "/home/msimonin/workspace/repos/python-sharelatex/sharelatex/__init__.py", line 178, in __init__
r = self._get(login_url, verify=self.verify)
File "/home/msimonin/workspace/repos/python-sharelatex/sharelatex/__init__.py", line 280, in _get
return self._request("GET", url, *args, **kwargs)
File "/home/msimonin/workspace/repos/python-sharelatex/sharelatex/__init__.py", line 275, in _request
r = self.client.request(verb, url, *args, **kwargs)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/msimonin/.pyenv/versions/3.6.5/envs/synchro-git-sharelatex/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1a1db9a320>: Failed to establish a new connection: [Errno -2] Name or service not known',))
It seems that the URL for this project is : https://sharelatex/<id>
and I suspect we made the assumption that all project url should be https://sharelatex/project/<uid>
.
I'm not sure on how we can handle this but having the uid
early in the workflow may help.