Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Wrangler 1.12 publish destroys Worker site #1625

Closed
SoftwareDreamer opened this issue Oct 29, 2020 · 19 comments
Closed

Wrangler 1.12 publish destroys Worker site #1625

SoftwareDreamer opened this issue Oct 29, 2020 · 19 comments
Assignees
Labels
bug Something isn't working investigate regression Something is broken, but works in previous releases

Comments

@SoftwareDreamer
Copy link

SoftwareDreamer commented Oct 29, 2020

🐛 Bug Report

New wrangler 1.12 destroyed our worker site in Ubuntu CI/CD Agent (and locally reproducible on Windows 10).

"destroyed" means the KV namespace is completely empty after publish, resulting in a simple "could not find index.html in your content namespace" error message when invoking the website

Switching back to wrangler 1.11 (fixing version in CI/CD pipeline) did fix the problem. So surprise, much blame!

UPDATE see below comment, the [env] stuff is a red herring, it also doesn't work with basically the simplest Worker site toml without any usage of --env.

Environment

  • operating system(s): Windows 10 (locally)/Ubuntu Linux (Azure DevOps CI/CD)
  • output of rustc -V: - not installed locally
  • output of node -v: v12.16.1
  • output of wrangler -V: wrangler 1.12.0
  • contents of wrangler.toml

Old toml

# to be set via environment
name = "dev" 
type = "webpack"
account_id = "[some account id]"
workers_dev = true
route = ""
zone_id = ""

[site]
bucket = "./dist"
entry-point = "workers-site"

# environment configuration
[env.local]
name = "local"

[env.dev]
name = "dev"

[env.prod]
name = "prod"

New simplified toml that stil exhibits the behavior:

# to be set via environment
name = "dev" 
type = "webpack"
account_id = "[some account id]"
workers_dev = true
route = ""
zone_id = ""

[site]
bucket = "./dist"
entry-point = "workers-site"

Steps to reproduce

Old toml
wrangler build --env dev
wrangler publish --env dev

Newer simple toml
wrangler build
wrangler publish

with a built vue SPA site (or any site) that gets built to /dist directory. I suppose the content of the website nor the bucket does really matter here..

What did you expect to see?

Worker site not being destroyed 10 minute before customer review..

What did you see instead?

"could not find index.html in your content namespace"
image

image

@SoftwareDreamer SoftwareDreamer changed the title Wrangler 0.12 destroys Worker site Wrangler 1.12 destroys Worker site Oct 29, 2020
@SoftwareDreamer SoftwareDreamer changed the title Wrangler 1.12 destroys Worker site Wrangler 1.12 publish destroys Worker site Oct 29, 2020
@nataliescottdavidson nataliescottdavidson self-assigned this Oct 30, 2020
@nataliescottdavidson nataliescottdavidson added bug Something isn't working regression Something is broken, but works in previous releases labels Oct 30, 2020
nataliescottdavidson added a commit that referenced this issue Oct 30, 2020
This reverts commit bf0601a.

Change caused a regression which destroyed deployments.
#1625
nataliescottdavidson added a commit that referenced this issue Oct 30, 2020
This reverts commit bf0601a.

Change caused a regression which destroyed deployments.
#1625
@rita3ko
Copy link
Contributor

rita3ko commented Oct 30, 2020

Hey @hkochniss! Thanks for reporting this.

We just reverted back the change we think is the culprit — please try wrangler 1.12.1 and let us know if you're still experiencing an issue — we haven't been able to repro so far.

@SoftwareDreamer
Copy link
Author

SoftwareDreamer commented Oct 30, 2020

Hrm this deeply confusing on my end.. when I run
npm uninstall -g @cloudflare/wrangler && npm install -g @cloudflare/wrangler

it clearly says

wrangler has been installed!
+ @cloudflare/wrangler@1.12.1
added 34 packages from 21 contributors in 1.39s

but wrangler -V still returns
wrangler 1.12.0

It clearly does return the right version for 1.11.0

So with this "new"(?) version it still doesn't work, published assets are empty. Rolled back to 1.11 to verify it still works on that version.

@SoftwareDreamer
Copy link
Author

SoftwareDreamer commented Oct 30, 2020

Ok there might be a red herring with the --env variable

If I remove --env param and I change the original name at top from "" to "wrongdeploy" and then do a simple wrangler build and wrangler publish it creates that 'wrongdeploy' worker, but still with an empty KV namespace. If I even remove the whole sections below # environment configuration it still doesn't work... I updated the original issue test with the new minimal toml

So it is seemingly not related to env settings at all.

Also I separately tried to just rename the dist folder to dist2, still the same issue.

It's weird that a simple publish (nothing else) with 1.11 just fills the namespace correctly, and with 1.12(.1) it doesn't, without any errors/feedback in # of uploaded files etc.. Output could be improved here.

I should note that this is the customer's account and I'm an invited admin. Maybe there is some rights issue? I don't know..
I'll try the same on my personal CF account and try to get a minimal repro that I can share once I find the time today (meaning in the next 8 hours, day in germany just started)..

@nataliescottdavidson
Copy link
Contributor

Hey @hkochniss, sorry that this happened. Since we weren't able to reproduce the issue, we reverted a change that seemed to be the most likely culprit. Unfortunately looks like that wasn't it. Can you send your account id to wrangler@cloudflare.com so that I can have a look at the logs to determine where this failure is coming from?

@SoftwareDreamer
Copy link
Author

SoftwareDreamer commented Oct 30, 2020

Thanks, no worries, fixing version to 1.11 fixes it for now and customer didn't see the problm, but I'm of course worried about others..

Just did send an email with AccountId with subject "regarding issue 1625"

Had a busy day, will try a minimal repro in github repo until tomorrow.

@lostpebble
Copy link

Yep, upgrading to 1.12 caused our site to stop working and return an error as well.

Downgraded to 1.11 and its working now. Also noticed the with the version not changing to 1.12.1 when doing wrangler -V - it still displayed 1.12.0.

@nataliescottdavidson
Copy link
Contributor

@hkochniss @lostpebble still trying to reproduce this, any chance you can share your project structure or private repo?

@erzr
Copy link

erzr commented Oct 30, 2020

@nataliescottdavidson I'll chime in here as well. I could reproduce this with 1.12. Downgrading to 1.11 resolved the issue for me. I added some steps in what I thought could be related issue yesterday: #1565 (comment)

@ObsidianMinor
Copy link
Contributor

I could reproduce this with a new generated default site template as well.

@SoftwareDreamer
Copy link
Author

SoftwareDreamer commented Oct 31, 2020

ok so I tried a few things:

  • installed wrangler on Windows 10 via cargo, it shows correct 1.12.1 via wrangler -V, still doesn't work, publishs no assets
  • switched to private CF Account, still doesn't work
  • used from-scratch template via wrangler generate --site my-site in a worker called "dev" still doesn't work
  • used from-scratch template via wrangler generate --site my-site in a worker called "test" still doesn't work

switching back to wrangler 1.11 does work. I really don't know what better repro steps to provide when the standard template approach from https://developers.cloudflare.com/workers/platform/sites/start-from-scratch doesn't work..
Also keep in midn I'm from germany, if there are any issues regarding CF cache regarding wrangler versions..

I would caution using the npm version right now, there really seems to be a software delivery chain problem when my npm version is not equal the rust version. Might be CF people from America fetch a wrong/old version..

Sorry, out of ideas here, please provide steps to help, a Github repo would literally only contain the wrangler generate --site my-site content plus second .toml ("New simplified toml that stil exhibits the behavior:")

@chocolatkey
Copy link

chocolatkey commented Nov 2, 2020

Can confirm, I was very confused. Luckily, decided to go to GitHub issues after exhausting all other options, and found this. Downgrading to 1.11 (yarn global add @cloudflare/wrangler@1.11) fixed it

ObsidianMinor pushed a commit to ObsidianMinor/wrangler that referenced this issue Nov 2, 2020
…)" (cloudflare#1626)

This reverts commit bf0601a.

Change caused a regression which destroyed deployments.
cloudflare#1625
@nataliescottdavidson
Copy link
Contributor

@ all who were affected by this, sincere apologies. 1.12.1 does not have the correct fix, 1.12.2 does.

@SoftwareDreamer
Copy link
Author

SoftwareDreamer commented Nov 4, 2020

just to confirm: works now and wrangler -V is correctly showing 1.12.2. Issue can be closed 🎉

@revelt
Copy link

revelt commented Aug 4, 2021

It's happening to me on Wrangler 1.19.0, it's flakey and sometimes website ends up with "could not find index.html in your content namespace" sometimes does not. I tried downgrading to 1.11, didn't help. But somehow, after 5th wrangler publish attempt, it did publish fine, I managed to delete the worker assets on Account GUI page manually, maybe that had influenced it. Website's repo in question is public, https://github.com/codsen/codsen.com

@zwily
Copy link

zwily commented Aug 24, 2021

I just had this happen to me on 1.19.0 as well. A re-publish fixed it, but it does not make me comfortable with future publishes.

@revelt
Copy link

revelt commented Aug 24, 2021

@nataliescottdavidson should we create a new issue or would you rather reopen this?

@thomkrupa
Copy link

I can confirm, it sometimes happens on 1.19.0. It seems to be pretty irregular and hard to debug.

@nkostic
Copy link

nkostic commented Apr 18, 2022

This happens to me with 1.19.11 if you visit my page https://nenadkostic.com you will see that each blog entry if reloaded returns that could not find index.html page. I tried 1.11, 1.18 multiple time build publish and same result. I can not share my links to anyone right now and all links that lead to my blog posts directly not accessible. Any workaround suggestions ?

@cookmscott
Copy link

I'm having this issue in wrangler 1.19.12 .. sad to see the flakiness of these deploys

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working investigate regression Something is broken, but works in previous releases
Projects
None yet
Development

No branches or pull requests