meeb / bandcampsync

Downloads your Bandcamp purchases automatically
BSD 3-Clause "New" or "Revised" License
133 stars 6 forks source link

Failure to start container: `NameError: name 'mask_sig' is not defined #13

Closed vin-cf closed 9 months ago

vin-cf commented 9 months ago

Reproduction steps:

$docker-compose --version
Docker Compose version v2.9.0-6413-g38f6acd

I have added a cookies.txt file as per the README

  1. Use the docker-compose.yml as defined in the README
  2. Run docker-compose up -d
  3. Check container logs

Result: The container does not start. Log is as shown

2023/10/23 16:41:14,stderr,"2023-10-23 16:41:14,264 bandcamp [INFO] Located Bandcamp session in cookies: {REDACTED}
"
2023/10/23 16:41:14,stderr,"2023-10-23 16:41:14,263 media [INFO] Local media directory: /downloads
"
2023/10/23 16:41:14,stderr,"2023-10-23 16:41:14,263 service [INFO] Starting synchronisation
"
2023/10/23 16:41:14,stderr,"2023-10-23 16:41:14,263 service [INFO] Running an initial one-off synchronisation immediately
"
2023/10/23 16:41:14,stderr,"2023-10-23 16:41:14,263 service [INFO] Time now in {REDACTED}
"
2023/10/23 16:41:14,stderr,"2023-10-23 16:41:14,263 service [INFO] Loaded cookies from \"/config/cookies.txt\"
"
2023/10/23 16:41:14,stderr,"2023-10-23 16:41:14,262 service [INFO] BandcampSync v0.3.3 starting
"
2023/10/23 16:41:13,stdout,Set service UID:GID to 1029:100

2023/10/23 16:41:13,stdout,usermod: no changes

2023/10/23 16:41:05,stderr,NameError: name 'mask_sig' is not defined

2023/10/23 16:41:05,stderr,                                                          ^^^^^^^^

2023/10/23 16:41:05,stderr,    raise BandcampError(f'Failed to make HTTP request to {mask_sig(url)}: {e}') from e

2023/10/23 16:41:05,stderr,"  File \"/usr/local/lib/python3.11/dist-packages/bandcampsync/bandcamp.py\", line 89, in _request
"
2023/10/23 16:41:05,stderr,           ^^^^^^^^^^^^^^^^^^^^^^^^^

2023/10/23 16:41:05,stderr,"    soup = self._request('get', url)
"
2023/10/23 16:41:05,stderr,"  File \"/usr/local/lib/python3.11/dist-packages/bandcampsync/bandcamp.py\", line 147, in verify_authentication
"
2023/10/23 16:41:05,stderr,    bandcamp.verify_authentication()

2023/10/23 16:41:05,stderr,"  File \"/usr/local/lib/python3.11/dist-packages/bandcampsync/__init__.py\", line 19, in do_sync
"
2023/10/23 16:41:05,stderr,"    do_sync(cookies_path, cookies, dir_path, media_format_env)
"
2023/10/23 16:41:05,stderr,"  File \"/usr/local/bin/bandcampsync-service\", line 67, in <module>
"
2023/10/23 16:41:05,stderr,Traceback (most recent call last):

2023/10/23 16:41:05,stderr,

2023/10/23 16:41:05,stderr,"During handling of the above exception, another exception occurred:
"
2023/10/23 16:41:05,stderr,

2023/10/23 16:41:05,stderr,"requests.exceptions.ConnectionError: HTTPSConnectionPool(host='bandcamp.com', port=443): Max retries exceeded with url: / (Caused by NameResolutionError(\"<urllib3.connection.HTTPSConnection object at 0x7fe01a30cf50>: Failed to resolve 'bandcamp.com' ([Errno -3] Temporary failure in name resolution)\"))
"
2023/10/23 16:41:05,stderr,"    raise ConnectionError(e, request=request)
"
2023/10/23 16:41:05,stderr,"  File \"/usr/local/lib/python3.11/dist-packages/requests/adapters.py\", line 519, in send
"
2023/10/23 16:41:05,stderr,        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023/10/23 16:41:05,stderr,"    r = adapter.send(request, **kwargs)
"
2023/10/23 16:41:05,stderr,"  File \"/usr/local/lib/python3.11/dist-packages/requests/sessions.py\", line 703, in send
"
2023/10/23 16:41:05,stderr,           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023/10/23 16:41:05,stderr,"    resp = self.send(prep, **send_kwargs)
"
2023/10/23 16:41:05,stderr,"  File \"/usr/local/lib/python3.11/dist-packages/requests/sessions.py\", line 589, in request
"
2023/10/23 16:41:05,stderr,               ^^^^^^^^^^^^^^^^^^^^^

2023/10/23 16:41:05,stderr,    response = self.session.request(

2023/10/23 16:41:05,stderr,"  File \"/usr/local/lib/python3.11/dist-packages/bandcampsync/bandcamp.py\", line 80, in _request
meeb commented 9 months ago

This has already been fixed thanks to a PR and will be in the next release.

meeb commented 9 months ago

Please update your container or pypi installed package to 0.3.6 which contains the fix for this. Thanks!