Page Not Found Astro

629f85705fb01e00093a0ca9–tourmaline-sorbet-7bebf3.netlify.app

HI there, new to Netlify. I am deploying a basic Astro build. I have included a netlify.toml file at root. In Netlify it shows as published but I get Page Not Found on preview.

Hi there,

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

If you are still seeing issues after following the troubleshooting steps in there, please check out this Support Guide as well. It outlines all of our build and deploy resources and will get you on the right track :slight_smile:

If none of the above resources help, please write back with your site name and what steps you have tried and we can look into this further!

Yes I have been through that thread looking for anything that might help. This is all there is in the netlify.toml file - It is a bare bones Astro intro site. The index.html file is showing in the deploy.

[build] command = "yarn build" publish = "dist"

next step would be to download what we deploy, and figure out if the index.html really is where you think it is supposed to be.

I know you probably are looking for more complex solution but 99.99% of the time the index really just isn’t a.) called what it is supposed to be b.) in the right place for us to find it, so that has to be ruled out first.

You are right of course, but I am a bit perplexed. I expected the netlify.toml file to run the build and get the index.html file from the dist/ directory, but it just publishes it AS IS. /fhtt/dist/index.html - if I go to that url then of course the index is there.

can you pop a screenshot of your build settings, please? lets try and figure this out:

Site settings > Build & deploy > Continuous Deployment > Build settings .

(the above is an example, i’m interested in seeing what yours look like)

@perry

see where is the problem I am
getting page not found error

@perry No need brother after doing some changes in the Settings it worked.
Thanks for the time <3

I feel like this thread got hijacked slightly :slight_smile: Sorry I was slow to get back…

this is the deploy log

Blockquote
7:21:31 PM: Build ready to start
7:21:45 PM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
7:21:45 PM: build-image tag: v4.8.0
7:21:45 PM: buildbot version: d7330f24833f29d0263d28116347ab83094a2561
7:21:45 PM: Fetching cached dependencies
7:21:45 PM: Failed to fetch cache, continuing with build
7:21:45 PM: Starting to prepare the repo for build
7:21:45 PM: No cached dependencies found. Cloning fresh repo
7:21:45 PM: git clone https://github.com/opalepatrick/fhtt
7:21:46 PM: Preparing Git Reference refs/heads/master
7:21:46 PM: Parsing package.json dependencies
7:21:47 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: β€˜fhtt/dist’ versus β€˜fhtt/dist/’ in the Netlify UI
7:21:47 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: β€˜fhtt/dist’ versus β€˜β€™ in the Netlify UI
7:21:47 PM: Starting build script
7:21:47 PM: Installing dependencies
7:21:47 PM: Python version set to 2.7
7:21:48 PM: Downloading and installing node v16.15.1…
7:21:48 PM: Downloading https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz…
7:21:48 PM: Computing checksum with sha256sum
7:21:49 PM: Checksums matched!
7:21:51 PM: Now using node v16.15.1 (npm v8.11.0)
7:21:51 PM: Started restoring cached build plugins
7:21:51 PM: Finished restoring cached build plugins
7:21:51 PM: Attempting ruby version 2.7.2, read from environment
7:21:52 PM: Using ruby version 2.7.2
7:21:53 PM: Using PHP version 8.0
7:21:53 PM: Started restoring cached go cache
7:21:53 PM: Finished restoring cached go cache
7:21:53 PM: go version go1.16.5 linux/amd64
7:21:53 PM: go version go1.16.5 linux/amd64
7:21:53 PM: Installing missing commands
7:21:53 PM: Verify run directory
7:21:54 PM: ​
7:21:54 PM: ────────────────────────────────────────────────────────────────
7:21:54 PM: Netlify Build
7:21:54 PM: ────────────────────────────────────────────────────────────────
7:21:54 PM: ​
7:21:54 PM: ❯ Version
7:21:54 PM: @netlify/build 27.1.3
7:21:54 PM: ​
7:21:54 PM: ❯ Flags
7:21:54 PM: baseRelDir: true
7:21:54 PM: buildId: 62a38baa3d8b0402fee7d246
7:21:54 PM: deployId: 62a38baa3d8b0402fee7d248
7:21:54 PM: ​
7:21:54 PM: ❯ Current directory
7:21:54 PM: /opt/build/repo/fhtt/dist
7:21:54 PM: ​
7:21:54 PM: ❯ Config file
7:21:54 PM: No config file was defined: using default values.
7:21:54 PM: ​
7:21:54 PM: ❯ Context
7:21:54 PM: production
7:21:54 PM: ​
7:21:54 PM: ────────────────────────────────────────────────────────────────
7:21:54 PM: 1. Build command from Netlify app
7:21:54 PM: ────────────────────────────────────────────────────────────────
7:21:54 PM: ​
7:21:54 PM: $ astro build
7:21:54 PM: bash: astro: command not found
7:21:54 PM: ​
7:21:54 PM: ────────────────────────────────────────────────────────────────
7:21:54 PM: β€œbuild.command” failed
7:21:54 PM: ────────────────────────────────────────────────────────────────
7:21:54 PM: ​
7:21:54 PM: Error message
7:21:54 PM: Command failed with exit code 127: astro build (Search results for '"non-zero exit code: 127"' - Netlify Support Forums)
7:21:54 PM: ​
7:21:54 PM: Error location
7:21:54 PM: In Build command from Netlify app:
7:21:54 PM: astro build
7:21:54 PM: ​
7:21:54 PM: Resolved config
7:21:54 PM: build:
7:21:54 PM: base: /opt/build/repo/fhtt/dist
7:21:54 PM: command: astro build
7:21:54 PM: commandOrigin: ui
7:21:54 PM: publish: /opt/build/repo/fhtt/dist
7:21:54 PM: publishOrigin: default
7:21:55 PM: Caching artifacts
7:21:55 PM: Started saving build plugins
7:21:55 PM: Finished saving build plugins
7:21:55 PM: Started saving pip cache
7:21:55 PM: Finished saving pip cache
7:21:55 PM: Started saving emacs cask dependencies
7:21:55 PM: Finished saving emacs cask dependencies
7:21:55 PM: Started saving maven dependencies
7:21:56 PM: Creating deploy upload records
7:21:55 PM: Finished saving maven dependencies
7:21:55 PM: Started saving boot dependencies
7:21:55 PM: Finished saving boot dependencies
7:21:55 PM: Started saving rust rustup cache
7:21:55 PM: Finished saving rust rustup cache
7:21:57 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
7:21:55 PM: Started saving go dependencies
7:21:55 PM: Finished saving go dependencies
7:21:56 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:21:57 PM: Failing build: Failed to build site
7:21:57 PM: Finished processing build request in 12.12255892s

OK, I have resolved this. There were 2 things wrong. One, as you quite rightly suggested, the location mattered but in this case was a red herring. The most important thing was that I was using an integration and needed to add β€œastro build --experimental-integrations” - it now works. Thanks for the help