cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.7k stars 709 forks source link

🐛 BUG: Pages deployment tail (maybe) fails on last deployment if rolled back #2262

Open viantirreau opened 1 year ago

viantirreau commented 1 year ago

What version of Wrangler are you using?

2.4.2

What operating system are you using?

Linux

Describe the Bug

I had to rollback a deployment on my production branch and the logs stopped working.

wrangler pages deployment tail --environment production --project-name <project-name>

As I don't specify a deployment, wrangler fetches the latest one for production:

No deployment specified. Using latest deployment for production environment.

[ERROR] A request to the Cloudflare API (/accounts/6d6787b46d640c31f783b328dc24d651/pages/projects/miguru-offer-front/deployments/7719c98a-302a-452e-91c6-2ed426d817cd/tails) failed.

  An unknown error occurred [code: 8000000]

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

I think this error might have to do with the rollback, because as soon as I released a fix to the production branch (superseding that deployment id), the logs started working again.

jahands commented 1 year ago

Great catch! We should probably be using project.canonical_deployment.id (the current live production deployment) instead of the "latest".