vale46n1 / immich_duplicate_finder

A Comprehensive Solution for Identifying and Managing Duplicate Photos in Immich
Apache License 2.0
184 stars 12 forks source link

URLError: <urlopen error [Errno 101] Network is unreachable> #49

Open RobHofmann opened 2 months ago

RobHofmann commented 2 months ago

Hi guys,

I just tried running the latest version of this tool using this command:

docker run --name=immich-duplicate-finder --cpus=2 --memory=512MB -d --restart=unless-stopped --net=traefik-internal eulemitkeule/immich-duplicate-finder:latest

The backend config of my traefik is the following:

    immich-duplicate-finder:
      loadBalancer:
        passHostHeader: true
        servers:
          - url: http://immich-duplicate-finder:8501

I'm getting the following order whenever I go (through my reverse proxy; traefik) to the service.

URLError: <urlopen error [Errno 101] Network is unreachable>
Traceback:
File "/usr/local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script
    exec(code, module.__dict__)
File "/immich_duplicate_finder/app.py", line 9, in <module>
    from imageProcessing import streamAsset,calculatepHashPhotos,calculateFaissIndex
File "/immich_duplicate_finder/imageProcessing.py", line 7, in <module>
    from faissCalc import update_faiss_index
File "/immich_duplicate_finder/faissCalc.py", line 13, in <module>
    model = resnet152(weights=ResNet152_Weights.DEFAULT)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/torchvision/models/_utils.py", line 142, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/torchvision/models/_utils.py", line 228, in inner_wrapper
    return builder(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/torchvision/models/resnet.py", line 827, in resnet152
    return _resnet(Bottleneck, [3, 8, 36, 3], weights, progress, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/torchvision/models/resnet.py", line 301, in _resnet
    model.load_state_dict(weights.get_state_dict(progress=progress, check_hash=True))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/torchvision/models/_api.py", line 90, in get_state_dict
    return load_state_dict_from_url(self.url, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/torch/hub.py", line 766, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
File "/usr/local/lib/python3.12/site-packages/torch/hub.py", line 620, in download_url_to_file
    u = urlopen(req)
        ^^^^^^^^^^^^
File "/usr/local/lib/python3.12/urllib/request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/urllib/request.py", line 515, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/urllib/request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
File "/usr/local/lib/python3.12/urllib/request.py", line 1392, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/urllib/request.py", line 1347, in do_open
    raise URLError(err)

Do I miss something? I guess it has trouble with a reverse proxy.