Files appear in deploy preview but not in production


I am struggling to get my site to deploy correctly. When I run netlify deploy --prod the files upload correctly, and are visible on the preview site, but when I open them directly I get a 404 error. This is with the above custom domain and with the Netlify subdomain (no link because I already have two and am a newbie here). My source files are on Github (at samwilson/website) but I’m building the generated files locally and trying to deploy manually.

Is this because I don’t have the generated files in the repository? Is there some cache timeout that I should wait for? Should I just commit all generated files to the repo and enable automatic deployment?

Thanks for any help! And sorry if I’m missing something obvious. :slight_smile:


Hi @samwilson, it looks like the last production deploy you did via the API was on the 25th, but your last manual deploy preview was on the 27th. Did you try to do a production deploy via the api more recently? if so, can you link me to the deploy page on Netlify?


Sorry, yes: I kept trying a few different things to try to get things to work. No luck yet. (I’ve switched my custom domain back to my old site for now, till I figure all this out.)

Current status:

Thanks for any ideas you might have!


Hey Sam! Turned out to have a very reasonable explanation:

If you look, you have locked this deploy: (there is a “lock” icon next to it on your deploy listings page to indicate this:

So - this is our system doing what you asked :slight_smile: You can read more about locked deploys here: but the fix is just unlocking :wink:

1 Like

Woohoo, thank you! All is working.

I hadn’t quite taken in that turning off auto-publishing is the same as locking to a deploy. I thought I’d turn it off because I don’t want it deploying from the repo whenever I push there. I’ve turned it back on now.