Home
Support Forums

I've deployed my web application and it shows Page not Found

I’m new to coding and I’m currently working on a flask application. Every time I have tried to deploy the site, a page not found error pops up. I think I have followed every tip on Stack Overflow, Youtube and on here properly. Please help, thank you!
My Site name is heuristic-sammet-2f7ec2.netlify.app
Here’s the full build log:
9:31:01 AM: Build ready to start
9:31:04 AM: build-image version: 73def8bb10593b9b818f44989a75ea508018ccb7 (focal)
9:31:04 AM: build-image tag: v4.5.2
9:31:04 AM: buildbot version: 14fdb82524803865d49dbc4b5c6a92123299a12e
9:31:05 AM: Fetching cached dependencies
9:31:05 AM: Failed to fetch cache, continuing with build
9:31:05 AM: Starting to prepare the repo for build
9:31:05 AM: No cached dependencies found. Cloning fresh repo
9:31:05 AM: git clone https://github.com/rhodaa/webSayans
9:31:09 AM: Preparing Git Reference refs/heads/main
9:31:11 AM: Parsing package.json dependencies
9:31:11 AM: Starting build script
9:31:11 AM: Installing dependencies
9:31:11 AM: Python version set to 2.7
9:31:12 AM: Downloading and installing node v16.13.2…
9:31:12 AM: Downloading https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.xz
9:31:13 AM: Computing checksum with sha256sum
9:31:13 AM: Checksums matched!
9:31:16 AM: Now using node v16.13.2 (npm v8.1.2)
9:31:16 AM: Started restoring cached build plugins
9:31:16 AM: Finished restoring cached build plugins
9:31:16 AM: Attempting ruby version 2.7.2, read from environment
9:31:18 AM: Using ruby version 2.7.2
9:31:18 AM: Using PHP version 8.0
9:31:18 AM: Started restoring cached node modules
9:31:18 AM: Finished restoring cached node modules
9:31:19 AM: Installing NPM modules using NPM version 8.1.2
9:31:20 AM: npm WARN old lockfile
9:31:20 AM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
9:31:20 AM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
9:31:20 AM: npm WARN old lockfile
9:31:20 AM: npm WARN old lockfile This is a one-time fix-up, please be patient…
9:31:20 AM: npm WARN old lockfile
9:31:20 AM: added 2 packages, and audited 3 packages in 1s
9:31:20 AM: found 0 vulnerabilities
9:31:20 AM: NPM modules installed
9:31:21 AM: Started restoring cached go cache
9:31:21 AM: Finished restoring cached go cache
9:31:21 AM: go version go1.16.5 linux/amd64
9:31:21 AM: go version go1.16.5 linux/amd64
9:31:21 AM: Installing missing commands
9:31:21 AM: Verify run directory
9:31:22 AM: ​
9:31:22 AM: ────────────────────────────────────────────────────────────────
9:31:22 AM: Netlify Build
9:31:22 AM: ────────────────────────────────────────────────────────────────
9:31:22 AM: ​
9:31:22 AM: ❯ Version
9:31:22 AM: @netlify/build 26.1.1
9:31:22 AM: ​
9:31:22 AM: ❯ Flags
9:31:22 AM: baseRelDir: true
9:31:22 AM: buildId: 61dff155e78faa00088e9359
9:31:22 AM: deployId: 61dff155e78faa00088e935b
9:31:23 AM: ​
9:31:23 AM: ❯ Current directory
9:31:23 AM: /opt/build/repo
9:31:23 AM: ​
9:31:23 AM: ❯ Config file
9:31:23 AM: No config file was defined: using default values.
9:31:23 AM: ​
9:31:23 AM: ❯ Context
9:31:23 AM: branch-deploy
9:31:23 AM: ​
9:31:23 AM: ────────────────────────────────────────────────────────────────
9:31:23 AM: 1. Build command from Netlify app
9:31:23 AM: ────────────────────────────────────────────────────────────────
9:31:23 AM: ​
9:31:23 AM: $ CI= npm run build
9:31:23 AM: npm ERR! Missing script: “build”
9:31:23 AM: npm ERR!
9:31:23 AM: npm ERR! To see a list of scripts, run:
9:31:23 AM: npm ERR! npm run
9:31:23 AM: npm ERR! A complete log of this run can be found in:
9:31:23 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-01-13T09_31_23_459Z-debug.log
9:31:23 AM: ​
9:31:23 AM: ────────────────────────────────────────────────────────────────
9:31:23 AM: “build.command” failed
9:31:23 AM: ────────────────────────────────────────────────────────────────
9:31:23 AM: ​
9:31:23 AM: Error message
9:31:23 AM: Command failed with exit code 1: CI= npm run build
9:31:23 AM: ​
9:31:23 AM: Error location
9:31:23 AM: In Build command from Netlify app:
9:31:23 AM: CI= npm run build
9:31:23 AM: ​
9:31:23 AM: Resolved config
9:31:23 AM: build:
9:31:23 AM: command: CI= npm run build
9:31:23 AM: commandOrigin: ui
9:31:23 AM: publish: /opt/build/repo/dist
9:31:23 AM: publishOrigin: ui
9:31:23 AM: Caching artifacts
9:31:23 AM: Started saving node modules
9:31:23 AM: Finished saving node modules
9:31:23 AM: Started saving build plugins
9:31:23 AM: Finished saving build plugins
9:31:23 AM: Started saving pip cache
9:31:23 AM: Finished saving pip cache
9:31:23 AM: Started saving emacs cask dependencies
9:31:23 AM: Finished saving emacs cask dependencies
9:31:23 AM: Started saving maven dependencies
9:31:24 AM: Finished saving maven dependencies
9:31:24 AM: Started saving boot dependencies
9:31:24 AM: Finished saving boot dependencies
9:31:24 AM: Started saving rust rustup cache
9:31:24 AM: Finished saving rust rustup cache
9:31:24 AM: Started saving go dependencies
9:31:24 AM: Finished saving go dependencies
9:31:26 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:31:26 AM: Creating deploy upload records
9:31:26 AM: Failing build: Failed to build site
9:31:26 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
9:31:26 AM: Finished processing build request in 22.03125972s

Welcome to the forums @rhodaa

The relevant section of the deploy log is this:

What is is saying is there is no build script in the package.json file in the root of the repository i.e

scripts: {
  "build": "astro build",
  "dev": "astro dev"
}

(Note: I’ve used astro for demonstration purposes only.)

Is this a flask python framework? Is so, you might find the following blog post useful

Thank you so much for your help. I looked at the linked file and since my application is dynamic, it said it can’t be hosted serverlessly. I’ll try your tip to see if it helps. Thank you again.

1 Like