cloudflare / workers-sdk

โ›…๏ธ Home to Wrangler, the CLI for Cloudflare Workersยฎ
https://developers.cloudflare.com/workers/
Apache License 2.0
2.74k stars 726 forks source link

๐Ÿ› BUG: Python without external libraries: python modules not supported [code: 10021] #6613

Open PeterZhizhin opened 2 months ago

PeterZhizhin commented 2 months ago

Which Cloudflare product(s) does this pertain to?

Workers Runtime

What version(s) of the tool(s) are you using?

wrangler 3.73.0

What version of Node are you using?

10.8.3

What operating system and version are you using?

Arch Linux

Describe the Bug

Observed behavior

I'm trying to upload a python worker with source code here: https://github.com/PeterZhizhin/msk_deg_2024/tree/main/check_sid_bot_offline

I run the following command:

npx wrangler@latest deploy

See the log error I got below.

Expected behavior

Worker gets deployed normally.

Moreover, I have been able to deploy this worker as-is on 2024.04.02 (April 2nd 2024). Now exactly the same command fails.

Steps to reproduce

Please provide the following:

Please provide a link to a minimal reproduction

https://github.com/PeterZhizhin/msk_deg_2024/tree/main/check_sid_bot_offline

Please provide any relevant error logs


$ย npx wrangler@latest deploy                                                                                                                                                            

 โ›…๏ธ wrangler 3.73.0
-------------------

โ–ฒ [WARNING] The entrypoint src/entry.py defines a Python worker, support for Python workers is currently experimental. Python workers with a requirements.txt file can only be run locally and cannot be deployed.

Attaching additional modules:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Name              โ”‚ Type   โ”‚ Size     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ messages.py       โ”‚ python โ”‚ 0.70 KiB โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ telegram.py       โ”‚ python โ”‚ 4.42 KiB โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Total (2 modules) โ”‚        โ”‚ 5.12 KiB โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Total Upload: 7.88 KiB / gzip: 2.38 KiB
Your worker has access to the following bindings:
- KV Namespaces:
  - TELEGRAM_USERS: <Redacted ID of KV storage>

โœ˜ [ERROR] A request to the Cloudflare API (/accounts/<Redacted ID>/workers/scripts/check-sid-bot-offline/versions) failed.

  python modules not supported [code: 10021]

  If you think this is a bug, please open an issue at:
  https://github.com/cloudflare/workers-sdk/issues/new/choose
scrazzz commented 2 months ago

Looks like others are facing the same issue, see #5608

MilosNikolic commented 2 months ago

I am facing this issue as well. I was also able to reproduce it with hello world example. When i deploy the worker first time it works, but with when I try to re-deploy with any change it doesn't work.

Same error message and i also have wrangler 3.76.0.

kflansburg commented 2 months ago

Hello, @MilosNikolic I'm not able to reproduce issues when deploying the hello world example multiple times. What error are you getting.

@PeterZhizhin I believe that there may be a bug in our permissions for uploading modules, which should be permitted, we will investigate next week.

kflansburg commented 2 months ago

@PeterZhizhin I believe we released some changes last week which should have resolved this, can you try again?

rhjensen79 commented 1 month ago

Any status on this ? I'm getting the same error, when I do a basic test with a requirements file, with fastapi.

I'm following your example in https://blog.cloudflare.com/python-workers/

And I'm getting ` โ›…๏ธ wrangler 3.81.0

โ–ฒ [WARNING] The entrypoint src/entry.py defines a Python worker, support for Python workers is currently experimental. Python workers with a requirements.txt file can only be run locally and cannot be deployed.`

Which is not what the blog post describes.

rhjensen79 commented 1 month ago

Any status on this ? I'm getting the same error, when I do a basic test with a requirements file, with fastapi.

I'm following your example in https://blog.cloudflare.com/python-workers/

And I'm getting

โ›…๏ธ wrangler 3.81.0 โ–ฒ [WARNING] The entrypoint src/entry.py defines a Python worker, support for Python workers is currently experimental. Python workers with a requirements.txt file can only be run locally and cannot be deployed.

Which is not what the blog post describes.

Just updated Wrangler to 3.82.0 Same error.

`โœ˜ [ERROR] A request to the Cloudflare API (/accounts/1abcaa7d00a09e7d208cc58af0fe43d1/workers/scripts/hello-world-python-worker) failed.

You cannot yet deploy Python Workers that depend on packages defined in requirements.txt. Support for Python packages is coming soon. [code: 10021]

If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose`