Strange exit code when running Hugo on Travis CI


I am getting the following error when running Hugo on Travis CI

Started building sites ...
ERROR 2017/09/10 08:36:16 Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
ERROR 2017/09/10 08:36:16 Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
ERROR 2017/09/10 08:36:17 Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
Built site for language en:
0 draft content
0 future content
0 expired content
63 regular pages created
80 other pages created
0 non-page files copied
39 paginator pages created
36 tags created
total in 13314 ms
[08:36:24] 'hugo-build' errored after 13 s
[08:36:24] Error: Command `hugo` failed with exit code 255
    at ChildProcess.exithandler (child_process.js:270:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

This seems to be new, as prior builds completed without problems. But I really do not get what Hugo is trying to say me. Any suggestions?

Thanks in advance, Mirko


I assume you trigger this build from gulp or some other JS framework, so I would guess there is some issues in that interaction that does now work as intended. My guess would be that if you try to execute hugo directly from Travis, all would sail smoothly. So the exit code you see is most likely not the Hugo exit code.

But your post lacks a lot of context, so the above is guessing from me.


Seems that travisci introduced an environment variable called “_JAVA_OPTIONS”. Its presence seems to break Hugo in some way. Adding an unset _JAVA_OPTIONS to the build file fixed this issue. I still do not get why Hugo stops working of such kind of environment variable is set. This seems to be a bug in my point of view.