indigo-dc / udocker

A basic user tool to execute simple docker containers in batch or interactive systems without root privileges.
https://indigo-dc.github.io/udocker/
Apache License 2.0
1.32k stars 133 forks source link

login fails all the time #379

Closed fgma closed 1 year ago

fgma commented 1 year ago

Login to a registry fails all the time in version 1.3.5. No login token is actually stored. The problem is related to invalid code in get_v2_login_token() inside docker.py. Base64 encoding is not called the correct way which results in an error all the time. So no token is stored in the keystore.

Isolating the code and testing the line manually results in the following error:

Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import base64
>>> username = 'abc'
>>> password = '123'
>>>
>>> base64.b64encode(("%s:%s" % (username, password).encode("utf-8")).decode("ascii"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'encode'
>>>

This is reproducible on python 2.7.5. and 3.10.4. After fixing this issue I'm still not able to login to dockerhub. It would be great if someone could verify this is working at all.

mariojmdavid commented 1 year ago

should be fixed in branch dev-v1.3.6, but I need to verify a few other things related to the default repository setting

mariojmdavid commented 1 year ago

release 1.3.6