Started getting: Failed to normalize URL string. Returning in =


#1

Hi all,

I have a system that posts my builds my blog and pushes it live whenever I make a change. On travis where the build happens it uses the latest version of hugo (it does a go get -v ) and today I noticed that I get “Failed to normalize URL string. Returning in = “2017-3-predictions-for-the-web-and-platforms.html”” for every markdown file, where as yesterday I didn’t get any issues.

My loacl version was 0.17. and I just upgraded it to 0.19 and I am having trouble working out the issues and if I can fix it, or if I should wait for master to update.

Travis build:https://travis-ci.org/PaulKinlan/paul.kinlan.me/builds/189511876 (error happens in here)
Repo for my blog: https://github.com/PaulKinlan/paul.kinlan.me in case someone can spot something I am doing wrong.


#2

Out of curiosity, I tested your site – builds fine here.

Which means, I guess, that your installation method is faulty. We should update the docs about this, maybe, but doing any go get hugo cannot be “trusted” 100% anymore (you may get a too new version of a library) – Hugo now manages its dependencies.


#3

I should add that I just updated my hugo version like an hour (or ago) and also are getting lots of “Failed to normalized URL string” errors also.

Everything seem to work okay with my old version. Since I started with Hugo more frequently again, I figure I should update the tool.


#4

Today, I faced the same problem. Use the govendor tool to fetch the correct versions of Hugo’s dependencies.


#5

Yep. As of today, I am getting the “Failed to normalize URL string” error.

My Travis build was passing yesterday, and failing today.

Here is the result of my build:

https://travis-ci.org/misterorion/freud2lacan


#6

I am seeing the same thing.

Can build locally on version v0.18.1

Using go get -u -v github.com/spf13/hugo on my travis CI build with version v0.19-DEV fails with error ERROR 2017/01/07 01:57:34 Failed to normalize URL string. Returning in = “/”.


#7

I met the same problem in travisCI building, following is my solution:

Modify the .travis.yml file:

From:


install:
    - go get -u -v github.com/spf13/hugo
  
script:
    - hugo

To


install:
    - go get -u -v github.com/kardianos/govendor
    - go get -u -v github.com/spf13/hugo
    - cd $GOPATH/src/github.com/spf13/hugo && govendor sync && go install
  

script:
    - cd $HOME/gopath/src/github.com/YourBlogName/YourBlogName.github.io && hugo

Hope this will help you.


#8

Note that if you don’t need the shiniest new Hugo features, doing something like this may give you a more stable build:

https://github.com/bep/docuapi/blob/master/ci-install-hugo.sh


#9

Thanks. I faced the same problem on 0.19 DEV and installing govendor and running govendor sync helped.


#10

All seems fine, except:

$ go get -d -t -u github.com/kardianos/govendor/...
$ go get -d -t -u github.com/spf13/hugo/...
$ go build -a -i github.com/kardianos/govendor/...
$ go install github.com/kardianos/govendor/...
$ cd $GOPATH/src/github.com/spf13/hugo
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
$ govendor sync
$ git diff

is giving me:

diff --git a/vendor/vendor.json b/vendor/vendor.json
index f397393..52fe78a 100644
--- a/vendor/vendor.json
+++ b/vendor/vendor.json
@@ -257,7 +257,7 @@
                        "revisionTime": "2016-12-08T18:21:42Z"
                },
                {
-                       "checksumSHA1": "J7o9HQd7rg294kEa7P2fllTsArs=",
+                       "checksumSHA1": "WASQjQVYHiVtAOxvRbl6I23etGE=",
                        "path": "github.com/spf13/cast",
                        "revision": "56a7ecbeb18dde53c6db4bd96b541fd9741b8d44",
                        "revisionTime": "2016-12-24T17:25:03Z"

Supposedly, in my next commit, I shouldn’t include this change. Instead, what should I do?


Keeping vendor tree in sync with master
#11

P.S. I’m on the master branch:

$ git status --short --branch
## master...origin/master
 M vendor/vendor.json

$ git log -n 1 --oneline
d6000a2  all: Refactor to nonglobal template handling

EDIT: @bep answered here.