Deploy error on Netlify

Hi,
my site is not ready yet, but I want to deploy the site to ask another question. But I get errors, if try to deploy on Netlify.

Here is my repo:
https://github.com/malde11/portfolio/tree/main

And this is the error i get:

5:43:35 PM: build-image version: 3d3c7e8b4321e2c1a54a2c4584fb46ba742b1630 (focal)
5:43:35 PM: buildbot version: 3d3c7e8b4321e2c1a54a2c4584fb46ba742b1630
5:43:36 PM: Fetching cached dependencies
5:43:36 PM: Failed to fetch cache, continuing with build
5:43:36 PM: Starting to prepare the repo for build
5:43:36 PM: No cached dependencies found. Cloning fresh repo
5:43:36 PM: git clone --filter=blob:none https://github.com/malde11/portfolio
5:43:36 PM: Preparing Git Reference refs/heads/main
5:43:39 PM: Starting to install dependencies
5:43:39 PM: Python version set to 3.8
5:43:40 PM: Attempting Ruby version 2.7.2, read from environment
5:43:41 PM: Using Ruby version 2.7.2
5:43:42 PM: Started restoring cached go cache
5:43:42 PM: Finished restoring cached go cache
5:43:42 PM: go version go1.19.13 linux/amd64
5:43:43 PM: Using PHP version 8.0
5:43:43 PM: Installing Hugo 0.125.2
5:43:44 PM: hugo v0.125.2-4e483f5d4abae136c4312d397a55e9e1d39148df+extended linux/amd64 BuildDate=2024-04-20T15:29:44Z VendorInfo=gohugoio
5:43:46 PM: v18.20.2 is already installed.
5:43:46 PM: Now using node v18.20.2 (npm v10.5.0)
5:43:46 PM: Enabling Node.js Corepack
5:43:46 PM: Started restoring cached build plugins
5:43:46 PM: Finished restoring cached build plugins
5:43:47 PM: Successfully installed dependencies
5:43:47 PM: Starting build script
5:43:48 PM: Detected 1 framework(s)
5:43:48 PM: "hugo" at version "unknown"
5:43:48 PM: Section completed: initializing
5:43:50 PM: ​
5:43:50 PM: Netlify Build                                                 
5:43:50 PM: ────────────────────────────────────────────────────────────────
5:43:50 PM: ​
5:43:50 PM: ❯ Version
5:43:50 PM:   @netlify/build 29.39.2
5:43:50 PM: ​
5:43:50 PM: ❯ Flags
5:43:50 PM:   baseRelDir: true
5:43:50 PM:   buildId: 66268597af8a9b0c47cd9b24
5:43:50 PM:   deployId: 66268597af8a9b0c47cd9b26
5:43:50 PM: ​
5:43:50 PM: ❯ Current directory
5:43:50 PM:   /opt/build/repo
5:43:50 PM: ​
5:43:50 PM: ❯ Config file
5:43:50 PM:   No config file was defined: using default values.
5:43:50 PM: ​
5:43:50 PM: ❯ Context
5:43:50 PM:   production
5:43:50 PM: ​
5:43:50 PM: Build command from Netlify app                                
5:43:50 PM: ────────────────────────────────────────────────────────────────
5:43:50 PM: ​
5:43:50 PM: $ hugo
5:43:50 PM: Start building sites …
5:43:50 PM: hugo v0.125.2-4e483f5d4abae136c4312d397a55e9e1d39148df+extended linux/amd64 BuildDate=2024-04-20T15:29:44Z VendorInfo=gohugoio
5:43:50 PM: ERROR render of "page" failed: "/opt/build/repo/layouts/_default/baseof.html:5:12": execute of template failed: template: portfolio/single.html:5:12: executing "portfolio/single.html" at <partial "header.html" .>: error calling partial: "/opt/build/repo/layouts/partials/header.html:21:19": execute of template failed: template: partials/header.html:21:19: executing "partials/header.html" at <len $menu>: error calling len: reflect: call of reflect.Value.Type on zero Value
5:43:50 PM: ERROR render of "home" failed: "/opt/build/repo/layouts/_default/baseof.html:5:12": execute of template failed: template: index.html:5:12: executing "index.html" at <partial "header.html" .>: error calling partial: "/opt/build/repo/layouts/partials/header.html:21:19": execute of template failed: template: partials/header.html:21:19: executing "partials/header.html" at <len $menu>: error calling len: reflect: call of reflect.Value.Type on zero Value
5:43:50 PM: Total in 41 ms
5:43:50 PM: Error: error building site: render: failed to render pages: render of "taxonomy" failed: "/opt/build/repo/layouts/_default/baseof.html:5:12": execute of template failed: template: _default/list.html:5:12: executing "_default/list.html" at <partial "header.html" .>: error calling partial: "/opt/build/repo/layouts/partials/header.html:21:19": execute of template failed: template: partials/header.html:21:19: executing "partials/header.html" at <len $menu>: error calling len: reflect: call of reflect.Value.Type on zero Value
5:43:50 PM: ​
5:43:50 PM: "build.command" failed                                        
5:43:50 PM: ────────────────────────────────────────────────────────────────
5:43:50 PM: ​
5:43:50 PM:   Error message
5:43:50 PM:   Command failed with exit code 1: hugo (https://ntl.fyi/exit-code-1)
5:43:50 PM: ​
5:43:50 PM:   Error location
5:43:50 PM:   In Build command from Netlify app:
5:43:50 PM:   hugo
5:43:50 PM: ​
5:43:50 PM:   Resolved config
5:43:50 PM:   build:
5:43:50 PM:     command: hugo
5:43:50 PM:     commandOrigin: ui
5:43:50 PM:     environment:
5:43:50 PM:       - HUGO_VERSION
5:43:50 PM:     publish: /opt/build/repo/public
5:43:50 PM:     publishOrigin: ui
5:43:51 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
5:43:51 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:43:51 PM: Failing build: Failed to build site
5:43:51 PM: Finished processing build request in 15.589s

I am new to hugo, hope someone can help me.

You have conflicting config files. Remove hugo.toml, then rename config.toml to hugo.toml. And make sure the baseURL is correct.

Hi, thanks for your answer, but I have got still errors at build.

How can I set the baseURL? Or how do i know it? I have got an domain, but I want to try netlify`s domain first.

Edit: Got it… thanks!!!

In this theme the config.toml was in the theme folder and therefore i got errors. Copied and pasted it in the root directory and renamed it fixed it.

After making the changes described above, your site builds locally without errors.

hugo.toml
baseURL       = "https://kettenbeil.com"
languageCode  = "en-US"
title         = "Kettenbeil | Creative Design Agency"
theme         = "roxo-hugo"
summarylength = 25

# Site Menus
[menu]
  # Navbar Menus
  [[menu.nav]]
    name    = "Home"
    url     = ""
    weight  = 1
  [[menu.nav]]
    name    = "About"
    url     = "about"
    weight  = 2
  [[menu.nav]]
    name    = "Portfolio"
    url     = "portfolio"
    weight  = 3
  [[menu.nav]]
    name    = "Blog"
    url     = "blog"
    weight  = 4
  [[menu.nav]]
    name    = "Get in touch"
    url     = "contact"
    weight  = 5

# Site Params
[params]
  logo = "images/logo.png"
  logo_footer = "images/logo-footer.png"
  favicon_icon = "images/favicon.ico"
  favicon_shortcut_icon = "images/favicon.png"
  custom_stylesheets = []   # [ "scss/my_1.scss", "scss/my_2.scss" ]
  dateFormat = "26 FEB 1994"
  # Meta data
  description = "Roxo Hugo themes | Design Agency Template by StaticMania"
  author = "StaticMania"
  # Google Analitycs
  googleAnalitycsID = "Your ID"
  # We're using formspree.io for form handling, paste your formspree url below
  fabform  = "https://fabform.io/f/USAg2Jl"

  # Contact Form
  [params.contactForm]
    placeholder_first_name        = "First Name"
    placeholder_last_name         = "Last Name"
    placeholder_email             = "Email"
    placeholder_project_type      = "Project Type"
    placeholder_about_the_project = "About the Project"
    send_message                  = "Send Message"

    [[params.contactForm.projectType]]
      value = "gd"
      title  = "Graphics Design"
    [[params.contactForm.projectType]]
      value = "wd"
      title  = "Web Design"

  # Navbar Action Button
  [params.navAction]
    status  = true
    name    = "Get in touch"
    url     = "contact"


  # Banner Section
  [params.banner]
    enable                = true
    background_image      = "images/backgrounds/hero-background.jpg"
    heading               = "We’re a Design Studio That Belies In the Great Ideas"
    tagline               = "WE WORK HARD, WE PLAY HARD"
    primary_button        = "See Our Works"
    primary_button_url    = "portfolio"
    secondary_button      = "Connect with Us"
    secondary_button_url  = "contact"

  [params.blog]
    read_more             = "read more"

  [params.portfolio]
    enable    = true
    title     = "OUR RECENT WORKS"
    subtitle  = "Crafting experiences and seeking to make the complex clear & beautiful."
    view_project = "view project"
    more_works = "MORE WORKS"
    scroll_down = "scroll down"

  [params.call_to_action]
    enable              = true
    background_image    = "images/backgrounds/cta-background.jpg"
    title               = "LET’S WORK TOGETHER"
    primary_button      = "Submit Query"
    primary_button_url  = "contact"
    secondary_button    = "Not Convinced"
    secondary_button_url = "portfolio"

  [params.footer]
    params.footer.qr_print = false
    # Footer Contact Info
    [params.footer.contactInfo]
      title   = "Contact Info"
      address = "713 Elmwood St.<br>Prior Lake, MN 55372"
      phone   = "409-896-1444"
      email   = "info@roxo.co"
      # Footer Sitemap
      [params.footer.sitemap]
        title   = "Sitemap"
        [[params.footer.sitemap.link]]
          name = "About Company"
          url  = "about"
        [[params.footer.sitemap.link]]
          name = "Projects"
          url  = "portfolio"
        [[params.footer.sitemap.link]]
          name = "Blog"
          url  = "blog"
        [[params.footer.sitemap.link]]
          name = "Contact"
          url  = "contact"
      # Footer Social Media
      [params.footer.social]
        title   = "Social Media"
        [[params.footer.social.link]]
          name = "Medium"
          url  = "#"
        [[params.footer.social.link]]
          name = "Behance"
          url  = "#"
        [[params.footer.social.link]]
          name = "Dribbble"
          url  = "#"
        [[params.footer.social.link]]
          name = "Instagram"
          url  = "#"
      # Footer Service
      [params.footer.service]
        title       = "We help brands:"
        description = "develop design solutions<br>produce valuable cultural content<br>create fresh brand experience"
      [params.footer.back_to_top]
        description = "I want to <br> visit again"


Thanks :smiley:

I do not have css?!
And what is the baseURL… I can see it in the hugo.toml, but what should I insert there?

Again… got it :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.