Failed deployment easy fix?

Hello forum members. I’m using a note taking program called Obsidian and I’m trying to publish my notes via Github through Netlify. When trying to deploy my site I get this error:

1:44:44 PM: Netlify Build
1:44:44 PM: ────────────────────────────────────────────────────────────────
1:44:44 PM: ​
1:44:44 PM: ❯ Version
1:44:44 PM: @netlify/build 29.31.4
1:44:44 PM: ​
1:44:44 PM: ❯ Flags
1:44:44 PM: baseRelDir: true
1:44:44 PM: buildId: 659e912a697f68de7f1f27b1
1:44:44 PM: deployId: 659e912a697f68de7f1f27b3
1:44:44 PM: ​
1:44:44 PM: ❯ Current directory
1:44:44 PM: /opt/build/repo
1:44:44 PM: ​
1:44:44 PM: ❯ Config file
1:44:44 PM: /opt/build/repo/netlify.toml
1:44:44 PM: ​
1:44:44 PM: ❯ Context
1:44:44 PM: production
1:44:44 PM: ​
1:44:44 PM: build.command from netlify.toml
1:44:44 PM: ────────────────────────────────────────────────────────────────
1:44:44 PM: ​
1:44:44 PM: $ npm install && npm run build
1:44:45 PM: up to date, audited 488 packages in 792ms
1:44:45 PM: 120 packages are looking for funding
1:44:45 PM: run npm fund for details
1:44:45 PM: 4 vulnerabilities (2 moderate, 2 high)
1:44:45 PM: To address issues that do not require attention, run:
1:44:45 PM: npm audit fix
1:44:45 PM: Some issues need review, and may require choosing
1:44:45 PM: a different dependency.
1:44:45 PM: Run npm audit for details.
1:44:45 PM: > web@1.0.0 build
1:44:45 PM: > npm-run-all get-theme build:*
1:44:45 PM: > web@1.0.0 get-theme
1:44:45 PM: > node src/site/get-theme.js
1:44:46 PM: > web@1.0.0 build:eleventy
1:44:46 PM: > cross-env ELEVENTY_ENV=prod NODE_OPTIONS=–max-old-space-size=4096 eleventy
1:45:06 PM: Failed during stage “building site”: Build script returned non-zero exit code: 2
1:45:06 PM: [11ty] Problem writing Eleventy templates: (more in DEBUG output)
1:45:06 PM: [11ty] Output conflict: multiple input files are writing to dist/index.html. Use distinct permalink values to resolve this conflict.
1:45:06 PM: [11ty] 1. ./src/site/notes/Vault Manager/Home.md
1:45:06 PM: [11ty] 2. ./src/site/notes/Vault Manager/Homepage.md (via DuplicatePermalinkOutputError)
1:45:06 PM: [11ty]
1:45:06 PM: [11ty] Original error stack trace: (Repeated output has been truncated…)
1:45:06 PM: [11ty] at TemplateMap.checkForDuplicatePermalinks (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateMap.js:803:13)
1:45:06 PM: [11ty] at TemplateMap.cache (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateMap.js:488:10)
1:45:06 PM: [11ty] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
1:45:06 PM: [11ty] at async TemplateWriter._createTemplateMap (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateWriter.js:330:5)
1:45:06 PM: [11ty] at async TemplateWriter.generateTemplates (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateWriter.js:360:5)
1:45:06 PM: [11ty] at async TemplateWriter.write (/opt/build/repo/node_modules/@11ty/eleventy/src/TemplateWriter.js:407:23)
1:45:06 PM: [11ty] at async Eleventy.executeBuild (/opt/build/repo/node_modules/@11ty/eleventy/src/Eleventy.js:1191:13)
1:45:06 PM: [11ty] Wrote 0 files in 19.43 seconds (v2.0.1)
1:45:06 PM: ERROR: “build:eleventy” exited with 1.
1:45:06 PM: ​
1:45:06 PM: “build.command” failed
1:45:06 PM: ────────────────────────────────────────────────────────────────
1:45:06 PM: ​
1:45:06 PM: Error message
1:45:06 PM: Command failed with exit code 1: npm install && npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
1:45:06 PM: ​
1:45:06 PM: Error location
1:45:06 PM: In build.command from netlify.toml:
1:45:06 PM: npm install && npm run build
1:45:06 PM: ​
1:45:06 PM: Resolved config
1:45:06 PM: build:
1:45:06 PM: command: npm install && npm run build
1:45:06 PM: commandOrigin: config
1:45:06 PM: publish: /opt/build/repo/dist
1:45:06 PM: publishOrigin: config
1:45:06 PM: redirects:
1:45:06 PM: - from: /api/*
status: 200
to: /.netlify/functions/:splat
- from: /*
status: 404
to: /404
redirectsOrigin: config
1:45:06 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:45:06 PM: Failing build: Failed to build site
1:45:06 PM: Finished processing build request in 38.932s

I’ve searched many posts here but I just can’t get it working. What do you guys suggest?
Thanks :slight_smile:

@ByteForce Your build appears to be throwing warnings which will cause the build to fail by default, you can disable this by setting CI to false.

You shouldn’t need to run npm install yourself either.

Try changing your Build command from npm install && npm run build to CI= npm run build.

There does appear to be an actual error there too:

1:45:06 PM: [11ty] Problem writing Eleventy templates: (more in DEBUG output)
1:45:06 PM: [11ty] Output conflict: multiple input files are writing to dist/index.html. Use distinct permalink values to resolve this conflict.
1:45:06 PM: [11ty] 1. ./src/site/notes/Vault Manager/Home.md
1:45:06 PM: [11ty] 2. ./src/site/notes/Vault Manager/Homepage.md (via DuplicatePermalinkOutputError)
...
1:45:06 PM: ERROR: “build:eleventy” exited with 1.

You should try running your build command locally, the issue should also occur there and it will be easier to debug than running on Netlify.

I’m entirely unfamiliar with what you’re working with, but the error appears to indicate both the Home.md and Homepage.md files are trying to write to index.html, it’s likely one of them is an accidental duplicate and should just be deleted.

1 Like

Thank you. It works perfectly now :slight_smile: