zacharee / unifi-cam-proxy

Enable non-Ubiquiti cameras to work with Unifi NVR
MIT License
27 stars 6 forks source link

Can't build your fork #1

Closed royassas closed 1 month ago

royassas commented 5 months ago

Camera

Tapo C100

Firmware version of the camera

No response

Description

Hey @zacharee

Thanks for your fork. I'm trying to use it for my tapo cam. I've adapted my docker compose file to build from your repo. Unfortunately the build can't complete with the following error

This runs on a Raspberry pi.

 => CACHED [unifi-cam-proxy internal] load git source https://github.com/zacharee/unifi-cam-proxy.git                                                                                                                                                                                                                   
 => [unifi-cam-proxy internal] load metadata for docker.io/library/python:3.11-alpine3.17                                                                                                                                                                                                                               
 => [unifi-cam-proxy builder 1/6] FROM docker.io/library/python:3.11-alpine3.17@sha256:607af960065410fcfabfb7402ef4b7e8bf8e79691c63a99a2c14e7c07efa1774                                                                                                                                                                 
 => CACHED [unifi-cam-proxy builder 2/6] WORKDIR /app                                                                                                                                                                                                                                                                   
 => CACHED [unifi-cam-proxy builder 3/6] RUN apk add --update         cargo         git         gcc         g++         jpeg-dev         libc-dev         linux-headers         musl-dev         patchelf         rust         zlib-dev                                                                                 
 => CACHED [unifi-cam-proxy builder 4/6] RUN pip install -U pip wheel setuptools maturin                                                                                                                                                                                                                                
 => CACHED [unifi-cam-proxy builder 5/6] COPY requirements.txt .  
 => ERROR [unifi-cam-proxy builder 6/6] RUN pip install -r requirements.txt --no-build-isolation                                                                                                                                                                                                                      139.2s
------
 > [unifi-cam-proxy builder 6/6] RUN pip install -r requirements.txt --no-build-isolation:
2.426 Collecting flvlib3@ https://github.com/zkonge/flvlib3/archive/master.zip (from -r requirements.txt (line 7))
3.155   Downloading https://github.com/zkonge/flvlib3/archive/master.zip
3.200      - 33.5 kB 3.4 MB/s 0:00:00
3.230   Preparing metadata (setup.py): started
3.995   Preparing metadata (setup.py): finished with status 'done'
5.413 Collecting aiohttp==3.9.5 (from -r requirements.txt (line 1))
5.623   Downloading aiohttp-3.9.5.tar.gz (7.5 MB)
6.323      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 MB 10.9 MB/s eta 0:00:00
7.513   Preparing metadata (pyproject.toml): started
8.491   Preparing metadata (pyproject.toml): finished with status 'done'
8.569 Collecting amcrest==1.9.8 (from -r requirements.txt (line 2))
8.587   Downloading amcrest-1.9.8-py3-none-any.whl.metadata (7.2 kB)
8.676 Collecting paho-mqtt==2.1.0 (from -r requirements.txt (line 3))
8.694   Downloading paho_mqtt-2.1.0-py3-none-any.whl.metadata (23 kB)
8.878 Collecting aiomqtt==2.1.0 (from -r requirements.txt (line 4))
8.896   Downloading aiomqtt-2.1.0-py3-none-any.whl.metadata (6.8 kB)
9.015 Collecting backoff==2.2.1 (from -r requirements.txt (line 5))
9.032   Downloading backoff-2.2.1-py3-none-any.whl.metadata (14 kB)
9.164 Collecting coloredlogs==15.0.1 (from -r requirements.txt (line 6))
9.190   Downloading coloredlogs-15.0.1-py2.py3-none-any.whl.metadata (12 kB)
9.274 Collecting hikvisionapi==0.3.2 (from -r requirements.txt (line 8))
9.294   Downloading hikvisionapi-0.3.2-py3-none-any.whl.metadata (5.1 kB)
9.425 Collecting packaging==24.0 (from -r requirements.txt (line 9))
9.442   Downloading packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
9.688 Collecting pyunifiprotect==5.2.0 (from -r requirements.txt (line 10))
9.794   Downloading pyunifiprotect-5.2.0-py3-none-any.whl.metadata (11 kB)
9.864 Collecting reolinkapi==0.1.5 (from -r requirements.txt (line 11))
9.969   Downloading reolinkapi-0.1.5-py3-none-any.whl.metadata (5.2 kB)
10.32 Collecting websockets==12.0 (from -r requirements.txt (line 12))
10.34   Downloading websockets-12.0-py3-none-any.whl.metadata (6.6 kB)
10.42 Collecting xmltodict==0.13.0 (from -r requirements.txt (line 13))
10.44   Downloading xmltodict-0.13.0-py2.py3-none-any.whl.metadata (7.7 kB)
10.61 Collecting pytapo==3.3.20 (from -r requirements.txt (line 14))
10.63   Downloading pytapo-3.3.20-py3-none-any.whl.metadata (5.6 kB)
10.74 Collecting aiosignal>=1.1.2 (from aiohttp==3.9.5->-r requirements.txt (line 1))
10.75   Downloading aiosignal-1.3.1-py3-none-any.whl.metadata (4.0 kB)
10.87 Collecting attrs>=17.3.0 (from aiohttp==3.9.5->-r requirements.txt (line 1))
10.89   Downloading attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
11.16 Collecting frozenlist>=1.1.1 (from aiohttp==3.9.5->-r requirements.txt (line 1))
11.18   Downloading frozenlist-1.4.1-py3-none-any.whl.metadata (12 kB)
12.10 Collecting multidict<7.0,>=4.5 (from aiohttp==3.9.5->-r requirements.txt (line 1))
12.12   Downloading multidict-6.0.5-py3-none-any.whl.metadata (4.2 kB)
12.73 Collecting yarl<2.0,>=1.0 (from aiohttp==3.9.5->-r requirements.txt (line 1))
12.75   Downloading yarl-1.9.4-py3-none-any.whl.metadata (31 kB)
12.94 Collecting argcomplete (from amcrest==1.9.8->-r requirements.txt (line 2))
12.96   Downloading argcomplete-3.3.0-py3-none-any.whl.metadata (16 kB)
13.11 Collecting httpx (from amcrest==1.9.8->-r requirements.txt (line 2))
13.13   Downloading httpx-0.27.0-py3-none-any.whl.metadata (7.2 kB)
13.32 Collecting requests (from amcrest==1.9.8->-r requirements.txt (line 2))
13.34   Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
13.45 Collecting typing-extensions (from amcrest==1.9.8->-r requirements.txt (line 2))
13.46   Downloading typing_extensions-4.11.0-py3-none-any.whl.metadata (3.0 kB)
13.66 Collecting urllib3 (from amcrest==1.9.8->-r requirements.txt (line 2))
13.68   Downloading urllib3-2.2.1-py3-none-any.whl.metadata (6.4 kB)
13.89 Collecting humanfriendly>=9.1 (from coloredlogs==15.0.1->-r requirements.txt (line 6))
13.91   Downloading humanfriendly-10.0-py2.py3-none-any.whl.metadata (9.2 kB)
14.15 Collecting aiofiles (from pyunifiprotect==5.2.0->-r requirements.txt (line 10))
14.17   Downloading aiofiles-23.2.1-py3-none-any.whl.metadata (9.7 kB)
14.26 Collecting aioshutil (from pyunifiprotect==5.2.0->-r requirements.txt (line 10))
14.28   Downloading aioshutil-1.3-py3-none-any.whl.metadata (2.5 kB)
14.39 Collecting dateparser (from pyunifiprotect==5.2.0->-r requirements.txt (line 10))
14.40   Downloading dateparser-1.2.0-py2.py3-none-any.whl.metadata (28 kB)
15.58 Collecting orjson (from pyunifiprotect==5.2.0->-r requirements.txt (line 10))
15.60   Downloading orjson-3.10.3.tar.gz (4.9 MB)
16.03      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.9/4.9 MB 11.6 MB/s eta 0:00:00
18.79   Preparing metadata (pyproject.toml): started
19.64   Preparing metadata (pyproject.toml): finished with status 'done'
20.55 Collecting pillow (from pyunifiprotect==5.2.0->-r requirements.txt (line 10))
20.57   Downloading pillow-10.3.0.tar.gz (46.6 MB)
31.17      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.6/46.6 MB 1.2 MB/s eta 0:00:00
49.75   Preparing metadata (pyproject.toml): started
62.69   Preparing metadata (pyproject.toml): finished with status 'done'
63.12 Collecting platformdirs (from pyunifiprotect==5.2.0->-r requirements.txt (line 10))
63.14   Downloading platformdirs-4.2.1-py3-none-any.whl.metadata (11 kB)
63.80 Collecting pydantic>=1.10.15 (from pyunifiprotect==5.2.0->-r requirements.txt (line 10))
63.82   Downloading pydantic-2.7.1-py3-none-any.whl.metadata (107 kB)
63.88      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.3/107.3 kB 2.0 MB/s eta 0:00:00
64.04 Collecting pyjwt (from pyunifiprotect==5.2.0->-r requirements.txt (line 10))
64.06   Downloading PyJWT-2.8.0-py3-none-any.whl.metadata (4.2 kB)
64.23 Collecting typer>0.6 (from typer[all]>0.6->pyunifiprotect==5.2.0->-r requirements.txt (line 10))
64.25   Downloading typer-0.12.3-py3-none-any.whl.metadata (15 kB)
64.51 Collecting PySocks==1.7.1 (from reolinkapi==0.1.5->-r requirements.txt (line 11))
64.53   Downloading PySocks-1.7.1-py3-none-any.whl.metadata (13 kB)
64.77 Collecting PyYaml==5.3.1 (from reolinkapi==0.1.5->-r requirements.txt (line 11))
64.80   Downloading PyYAML-5.3.1.tar.gz (269 kB)
64.87      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 269.4/269.4 kB 4.1 MB/s eta 0:00:00
65.67   Preparing metadata (setup.py): started
66.35   Preparing metadata (setup.py): finished with status 'done'
66.91 Collecting pycryptodome (from pytapo==3.3.20->-r requirements.txt (line 14))
66.93   Downloading pycryptodome-3.20.0.tar.gz (4.8 MB)
67.36      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.8/4.8 MB 11.3 MB/s eta 0:00:00
68.64   Preparing metadata (pyproject.toml): started
70.02   Preparing metadata (pyproject.toml): finished with status 'done'
70.09 Collecting rtp (from pytapo==3.3.20->-r requirements.txt (line 14))
70.11   Downloading rtp-0.0.4-py3-none-any.whl.metadata (2.1 kB)
70.45 Collecting annotated-types>=0.4.0 (from pydantic>=1.10.15->pyunifiprotect==5.2.0->-r requirements.txt (line 10))
70.47   Downloading annotated_types-0.6.0-py3-none-any.whl.metadata (12 kB)
73.13 Collecting pydantic-core==2.18.2 (from pydantic>=1.10.15->pyunifiprotect==5.2.0->-r requirements.txt (line 10))
73.15   Downloading pydantic_core-2.18.2.tar.gz (383 kB)
73.21      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 383.4/383.4 kB 7.4 MB/s eta 0:00:00
73.51   Preparing metadata (pyproject.toml): started
132.4   Preparing metadata (pyproject.toml): finished with status 'error'
132.5   error: subprocess-exited-with-error
132.5
132.5   × Preparing metadata (pyproject.toml) did not run successfully.
132.5   │ exit code: 1
132.5   ╰─> [20 lines of output]
132.5           Updating crates.io index
132.5       error: Unable to update registry `crates-io`
132.5
132.5       Caused by:
132.5         failed to fetch `https://github.com/rust-lang/crates.io-index`
132.5
132.5       Caused by:
132.5         process didn't exit successfully: `git fetch --force --update-head-ok 'https://github.com/rust-lang/crates.io-index' '+HEAD:refs/remotes/origin/HEAD'` (exit status: 128)
132.5         --- stderr
132.5         error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
132.5         error: 5720 bytes of body are still expected
132.5         fetch-pack: unexpected disconnect while reading sideband packet
132.5         fatal: early EOF
132.5         fatal: fetch-pack: invalid index-pack output
132.5       💥 maturin failed
132.5         Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
132.5         Caused by: `cargo metadata` exited with an error:
132.5       Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-jm227wgx', '--interpreter', '/usr/local/bin/python']' returned non-zero exit status 1.
132.5       Checking for Rust toolchain....
132.5       Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-jm227wgx --interpreter /usr/local/bin/python`
132.5       [end of output]
132.5
132.5   note: This error originates from a subprocess, and is likely not a problem with pip.
132.5 error: metadata-generation-failed
132.5
132.5 × Encountered error while generating package metadata.
132.5 ╰─> See above for output.
132.5
132.5 note: This is an issue with the package mentioned above, not pip.
132.5 hint: See above for details.

How to reproduce

use docker compose.yaml as listed in the docs

Expected behaviour

i expect the project to build

Screenshots

No response

Additional information

No response

zacharee commented 5 months ago

I think this might have been a GitHub outage. Rebuilding the image works fine for me.

royassas commented 5 months ago

Just tried running it again. Still get

149.5   × Preparing metadata (pyproject.toml) did not run successfully.
149.5   │ exit code: 1
149.5   ╰─> [20 lines of output]
149.5           Updating crates.io index
149.5       error: Unable to update registry `crates-io`
149.5
149.5       Caused by:
149.5         failed to fetch `https://github.com/rust-lang/crates.io-index`
149.5
149.5       Caused by:
149.5         process didn't exit successfully: `git fetch --force --update-head-ok 'https://github.com/rust-lang/crates.io-index' '+HEAD:refs/remotes/origin/HEAD'` (exit status: 128)
149.5         --- stderr
149.5         error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
149.5         error: 2832 bytes of body are still expected
149.5         fetch-pack: unexpected disconnect while reading sideband packet
149.5         fatal: early EOF
149.5         fatal: fetch-pack: invalid index-pack output
149.5       💥 maturin failed
149.5         Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
149.5         Caused by: `cargo metadata` exited with an error:
149.5       Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-9f10_vfr', '--interpreter', '/usr/local/bin/python']' returned non-zero exit status 1.
149.5       Checking for Rust toolchain....
149.5       Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-9f10_vfr --interpreter /usr/local/bin/python`
149.5       [end of output]
149.5
149.5   note: This error originates from a subprocess, and is likely not a problem with pip.
149.5 error: metadata-generation-failed

Think this could be related to #33742cd58d4d5705b841e0898c61bef3d597f9fd?

zacharee commented 5 months ago

No, it seems to be caused by your network connection not being able to pull that Rust repository. If docker compose build --no-cache doesn't work, try a different internet connection.

cweagans commented 4 months ago

I couldn't build either, but it was a different error -- pyunifiprotect doesn't seem to exist anymore. I swapped everything over to uiprotect instead and it worked great (only 3 replacements in the project - no API breakage since uiprotect is a fork of the original project)

zacharee commented 4 months ago

I pushed a change to replace the pyunifiprotect dependency.

simclancy commented 4 months ago

I pushed a change to replace the pyunifiprotect dependency.

Traceback (most recent call last): File "/usr/local/bin/unifi-cam-proxy", line 5, in <module> from unifi.main import main File "/usr/local/lib/python3.11/site-packages/unifi/main.py", line 8, in <module> from pyunifiprotect import ProtectApiClient ModuleNotFoundError: No module named 'pyunifiprotect'

zacharee commented 4 months ago

That should be fixed now.

simclancy commented 4 months ago

That should be fixed now.

Thanks just build the thing again and it runs again