Docker image and crypto.randomUUID

Hi, I've built a prodigy docker image generally following the steps from the Deployment instructions in support.

# Dockerfile
FROM python:3.12

WORKDIR /app

# Copy requirements and install them.
COPY requirements.txt .
RUN --mount=type=secret,id=PRODIGY_KEY \
    PRODIGY_KEY=$(cat /run/secrets/PRODIGY_KEY) && \
    python -m pip install --upgrade pip && \
    python -m pip install -r requirements.txt && \
    python -m pip install prodigy[company] -f https://$PRODIGY_KEY@download.prodi.gy

# Copy the rest of the app files.
COPY . /app

# Expose the appropriate port.
EXPOSE 8080

# The entrypoint. This script will also check for a mounted .env (for non-license config)
CMD ["bash", "run.sh"]

with requirements.txt

catalogue==2.0.10
certifi==2025.1.31
charset-normalizer==3.4.1
crypto==1.4.1
idna==3.10
Naked==0.1.32
pip==25.0.1
psycopg==3.2.4
python-dotenv==1.0.1
PyYAML==6.0.2
requests==2.32.3
setuptools==75.8.0
shellescape==3.8.1
srsly==2.5.1
typing_extensions==4.12.2
urllib3==2.3.0
wheel==0.45.1

When I launch the docker image, I get reassuring commands in the console:

(.conda) (base) me@you prodigy_imagebuild % docker run --rm --interactive --tty --volume $(pwd)/.env:/mnt/secrets/.env --volume $(pwd)/prodigy.json:/app/prodigy.json --publish 8080:8080 prodigy:latest


============================== ✨  Prodigy Stats ==============================

Version          1.17.5                        
License Type     Prodigy Company               
Location         /usr/local/lib/python3.12/site-packages/prodigy
Prodigy Home     /root/.prodigy                
Platform         Linux-6.10.14-linuxkit-aarch64-with-glibc2.36
Python Version   3.12.9                        
spaCy Version    3.7.5                         
Database Name    SQLite                        
Database Id      sqlite                        
Total Datasets   0                             
Total Sessions   0                             

Using 2 label(s): COMPANY, PERSON
Added dataset nyt to database SQLite.

✨  Starting the web server at http://0.0.0.0:8080 ...
Open the app in your browser and start annotating!

But I encounter this error when I load up the web app:

TypeError: crypto.randomUUID is not a function

    at _LabelList (http://0.0.0.0:8080/bundle.js:227:47831)
    at http://0.0.0.0:8080/bundle.js:74:39370
    at div
    at div
    at _Heading (http://0.0.0.0:8080/bundle.js:227:39076)
    at http://0.0.0.0:8080/bundle.js:74:39370
    at div
    at _NerManual (http://0.0.0.0:8080/bundle.js:308:39042)
    at http://0.0.0.0:8080/bundle.js:74:39370
    at div
    at _CardWithoutTheme (http://0.0.0.0:8080/bundle.js:308:98012)
    at http://0.0.0.0:8080/bundle.js:74:39370
    at Card (http://0.0.0.0:8080/bundle.js:308:100882)
    at ErrorBoundary (http://0.0.0.0:8080/bundle.js:308:141286)
    at div
    at div
    at _Annotator (http://0.0.0.0:8080/bundle.js:308:146003)
    at http://0.0.0.0:8080/bundle.js:74:39370
    at ConnectFunction (http://0.0.0.0:8080/bundle.js:64:13204)
    at main
    at div
    at _class2 (http://0.0.0.0:8080/bundle.js:79:44123)
    at _Main (http://0.0.0.0:8080/bundle.js:308:162714)
    at http://0.0.0.0:8080/bundle.js:74:39370
    at ConnectFunction (http://0.0.0.0:8080/bundle.js:64:13204)
    at ThemeProvider3 (http://0.0.0.0:8080/bundle.js:68:121250)
    at App (http://0.0.0.0:8080/bundle.js:310:7100)
    at Provider (http://0.0.0.0:8080/bundle.js:68:1343)

Any thoughts as to what may be happening or if I need to install additional pre-reqs?

Hi and welcome! It looks like you did all the Docker setup correctly and then hit this recently reported error:

We're currenty investigating what changed here because only some people have encountered it and it seems browser-speific. Could you share which operating system and browser + version you're using?

Hi @jcl,

We believe that crypto.randomUUID is not being supported in some network contexts due to browser's compatibility or some other network specific factors.

Since it is not essential for Prodigy to use crypto.randomUUID to generate the IDs, we have just released a version 1.18.0a1 that uses uuid package instead.

Could you install this version of Prodigy and see if that fixes your issue?
To install a specific version of Prodigy using pip, run:

python -m pip install prodigy==1.18.0a1 -f https://XXXX-XXXX-XXXX-XXXX@download.prodi.gy

Thank you.

Thanks, using prodigy version 1.18.0a1 has resolved the error for me.

(I didn't validate if my corporate firewalls were blocking it. Was using Arc 1.82.1 with chromium 133.0.6943.35.)

Glad to hear it's resolved. Thanks for reporting back @jcl!