404 page not found after deploy a new page

My new page shows 404 not found after deployment.

My site that is made by Hugo had worked fine before my latest deploy.

I made a new page example.com/admission/success/.
The file is /content/success/index.md .

content
 - admission
   - index.md
 - success
   - index.md

example.com/admission/ works fine but example.com/admission/success/ shows 404 page not found.

Both pages works fine in local hugo server.

I checked deployment list and the latest deploy marks as “published” so I downloaded “deployed files” and found that success directory and success/index.md are not deployed.

Trying to “Clear cache and deploy site” did not change the situation.

Thank you.

Hi there,

Did you see this guide yet? This is the best place to start for “Page Not Found” issues.

this might also be applicable:

If you are still seeing issues after following the troubleshooting steps in this guide, please let us know!

I think there is no problem on deployment.

Here is the deploy log:

6:03:03 PM: Build ready to start
6:03:05 PM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774
6:03:05 PM: build-image tag: v3.3.7
6:03:05 PM: buildbot version: 134ec431c6a3ff76e87cc4dc34007fe13842272f
6:03:05 PM: Fetching cached dependencies
6:03:05 PM: Starting to download cache of 254.9KB
6:03:05 PM: Finished downloading cache in 63.05453ms
6:03:05 PM: Starting to extract cache
6:03:05 PM: Failed to fetch cache, continuing with build
6:03:05 PM: Starting to prepare the repo for build
6:03:06 PM: No cached dependencies found. Cloning fresh repo
6:03:06 PM: git clone git@github.com:mewth/shiga-acpp
6:03:07 PM: Preparing Git Reference refs/heads/master
6:03:09 PM: Found Netlify configuration file netlify.toml in site root
6:03:09 PM: Found Netlify configuration file(s). Overriding site configuration
6:03:09 PM: Starting build script
6:03:09 PM: Installing dependencies
6:03:11 PM: Downloading and installing node v10.20.1...
6:03:11 PM: Downloading https://nodejs.org/dist/v10.20.1/node-v10.20.1-linux-x64.tar.xz...
6:03:11 PM: 
######################
6:03:11 PM:                                                    30.6%
6:03:11 PM: 
##############################
6:03:11 PM: ########################################## 100.0%
6:03:11 PM: Computing checksum with sha256sum
6:03:11 PM: Checksums matched!
6:03:15 PM: Now using node v10.20.1 (npm v6.14.4)
6:03:15 PM: Attempting ruby version 2.6.2, read from environment
6:03:17 PM: Using ruby version 2.6.2
6:03:18 PM: Using PHP version 5.6
6:03:18 PM: Installing Hugo 0.64.0
6:03:19 PM: Hugo Static Site Generator v0.64.0-241DB8F7/extended linux/amd64 BuildDate: 2020-02-04T09:14:57Z
6:03:19 PM: Started restoring cached go cache
6:03:19 PM: Finished restoring cached go cache
6:03:19 PM: unset GOOS;
6:03:19 PM: unset GOARCH;
6:03:19 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
6:03:19 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
6:03:19 PM: go version >&2;
6:03:19 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
6:03:19 PM: go version go1.12 linux/amd64
6:03:19 PM: Installing missing commands
6:03:19 PM: Verify run directory
6:03:19 PM: Executing user command: hugo --gc --minify -b $URL
6:03:20 PM: Building sites …
6:03:20 PM:                   | JA
6:03:20 PM: -------------------+
6:03:20 PM: -----
6:03:20 PM:   Pages            | 42
6:03:20 PM:   Paginator pages  |  0
6:03:20 PM:   Non-page files   |  1
6:03:20 PM:   Static files     | 17
6:03:20 PM:   Processed images |  3
6:03:20 PM:   Aliases          |  6
6:03:20 PM:   Sitemaps         |  1
6:03:20 PM:   Cleaned          |  0
6:03:20 PM: Total in 863 ms
6:03:20 PM: Skipping functions preparation step: no functions directory set
6:03:20 PM: Caching artifacts
6:03:20 PM: Started saving pip cache
6:03:20 PM: Finished saving pip cache
6:03:20 PM: Started saving emacs cask dependencies
6:03:20 PM: Finished saving emacs cask dependencies
6:03:20 PM: Started saving maven dependencies
6:03:20 PM: Finished saving maven dependencies
6:03:20 PM: Started saving boot dependencies
6:03:20 PM: Finished saving boot dependencies
6:03:20 PM: Started saving go dependencies
6:03:20 PM: Finished saving go dependencies
6:03:27 PM: Build script success
6:03:27 PM: Starting to deploy site from 'public'
6:03:27 PM: Creating deploy tree 
6:03:27 PM: Creating deploy upload records
6:03:27 PM: 0 new files to upload
6:03:27 PM: Starting post processing
6:03:27 PM: 0 new functions to upload
6:03:28 PM: Post processing done
6:03:28 PM: Site is live
6:03:56 PM: Finished processing build request in 51.034740163s

I mistaken the tree of the files.
The correct tree is below:

content/
 - admission/
   - index.md
   - success/
     - index.md

I checked the both guide.

First, I can see every pages of the website except example.com/admission/success/.

The last deploy is published.
It is true that the downloaded files(“deployed files”) dose not include /content/admission/success directory but the directory and /content/admission/success/index.md are added to the git repository.

Downloaded files includes both admission/index.html and /index.html.

Setting of the “Publish directory” is “public”.
Also example.com/admission/success/index.html returnes 404.

Thank you.

Hi, @rino, we need to look at the actual site to troubleshoot. Would you please let us know what site this is for?

You can send us the API ID if you don’t want to share a link to the site. The API ID is found under Site Name > Settings > General > Site information.

Hi @luke.

The API ID is 29f19fad-7902-43f8-a123-565544e80cc2.
Thank you!

Hi, @rino, I do see that the directory and file are not being created by hugo.

The repo is private so I’m not able to test this personally. The next step would be to make a fresh clone of the repo in a new directory and then run the build command (not hugo server) in the new directory. Something like this:

hugo --gc --minify

Then check the public directory to see if the HTML file is created there. If it is created in the newly cloned repo when the static build command is run, please let us know.

Hi @luke, thank you for your reply.

I did what you suggested but public/admission/success/ and public/admission/success/index.html were not created.

Thank you.

Hi, @rino, if the files are not created locally then you will need to get the local site build issue resolved before our support team may assist.

We can troubleshoot if the issue only happens at Netlify and not locally. If the same issue happens both places, then the site code is the issue. There is no issue at Netlify. The build at Netlify is only doing what the local build does. It isn’t a Netlify issue, it is a general site build issue. (Other people here in community may have bandwidth to troubleshoot general Hugo issues but our support team must focus on Netlify specific issues. It isn’t that we don’t want to assist, only that our time available doesn’t allow us to.)

If the file does get created locally and only isn’t created at Netlify, then our support team an assist with troubleshooting.

If you are troubleshooting the Hugo issue locally, it might also help to ask about that in the Hugo community here:

Again, if you get the file working locally and it only doesn’t work at Netlify, please let us know and we’ll we happy to keep troubleshooting. If anyone else wants to troubleshoot the local Hugo issue, please feel free to chime in here anytime.

Hi @luke, I understand.
Thank you for your kind messages.

May you try creating a netlify.toml in your root folder with this inside

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

See a similar issue here:
https://answers.netlify.com/t/react-routes-work-on-local-but-not-netlify/6760

A video solution for a 404 Page caused by Netlify deploy
https://youtu.be/btG_hk4TSbE

1 Like

Hi all!

Please help.

If deployment , build page, eror message:

" Page Not Found

Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.

Back to our site"

Webpage: https://adoring-bell-a10b66.netlify.app

Deploy log:

7:40:04 PM: Build ready to start
7:40:08 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
7:40:08 PM: build-image tag: v3.4.1
7:40:08 PM: buildbot version: 9042ba4998dab698f1f37fb8d36912c08a387191
7:40:08 PM: Fetching cached dependencies
7:40:08 PM: Failed to fetch cache, continuing with build
7:40:08 PM: Starting to prepare the repo for build
7:40:08 PM: No cached dependencies found. Cloning fresh repo
7:40:08 PM: git clone https://github.com/tiborbokor/hallo-hugo
7:40:09 PM: Preparing Git Reference refs/heads/master
7:40:10 PM: No build command found, continuing to publishing
7:40:10 PM: Starting to deploy site from ‘/’
7:40:10 PM: Creating deploy tree
7:40:10 PM: Creating deploy upload records
7:40:10 PM: 0 new files to upload
7:40:10 PM: 0 new functions to upload
7:40:10 PM: Starting post processing
7:40:10 PM: Post processing - HTML
7:40:10 PM: Post processing - header rules
7:40:10 PM: Post processing - redirect rules
7:40:10 PM: Post processing done
7:40:11 PM: Finished processing build request in 2.958592111s
7:40:11 PM: Site is live

Deploy from: https://github.com/tiborbokor/hallo-hugo

What is problem?
All template, error deploy (404 error page)

Thanks reply

Hey there,
You don’t have an index.html file in your root and I also don’t see a build command declared, which you’ll need for deploying a Hugo site:
7:40:10 PM: No build command found, continuing to publishing

This is a great place to start for deploying Hugo sites on Netlify:

Let us know if you have additional questions after reading it over!