iakta / hugocockpit

a Hugo addon for Cockpit-Next CMS, generating Hugo compatible content and running Hugo for you
56 stars 5 forks source link

Error Running Hugo #5

Open yudyananda opened 6 years ago

yudyananda commented 6 years ago

Hi there

Im using stable version of Cockpit and done all the Hugo cockpit instruction, but cannot run hugo.

The notification say "Eror running hugo" hugocockpit

zontarian commented 6 years ago

hi, I've never tested it on Windows, so maybe that's a problem. Besides this, could you please see in your php error log file (if you have one) and see what gets logged there?

And.. hugo binary is configured correctly? i.e. the Settings file has an entry for the hugo binary, maybe you have to hardcode it. On unix usually hugo is in the path so the default value works.

Please see the doc and set hugo_script according to your environment.

yudyananda commented 6 years ago

Hi thanks for the response

I managed to run Hugo without cockpit, so i assume that the binary is configured correctly

[Thu Dec 14 11:21:17.837414 2017] [php7:notice] [pid 13084:tid 1892] [client 127.0.0.1:10408] Creating hugo file C:\\xampp\\htdocs\\cockpit-master\\addons\\Hugo/config.yaml, referer: http://localhost/cockpit-master/
[Thu Dec 14 11:21:19.236443 2017] [php7:notice] [pid 13084:tid 1920] [client 127.0.0.1:10414] Config file is Array\n(\n    [hugo_script] => hugo\n    [hugo_conf_prefix] => config\n    [hugo_conf_extension] => toml\n    [cockpit_storage_prefix] => /storage/hugo\n    [hugo_extra_params] => --cleanDestinationDir --canonifyURLs\n    [hugo_base_dir] => E:/HUBLOG/original\n    [hugo_theme] => 311\n)\n, referer: http://localhost/cockpit-master/hugo
[Thu Dec 14 11:21:23.300907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] RUNNING HUGO! theme 311 and env prod, referer: http://localhost/cockpit-master/hugo
[Thu Dec 14 11:21:23.301907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] Config file is Array\n(\n    [hugo_script] => hugo\n    [hugo_conf_prefix] => config\n    [hugo_conf_extension] => toml\n    [cockpit_storage_prefix] => /storage/hugo\n    [hugo_extra_params] => --cleanDestinationDir --canonifyURLs\n    [hugo_base_dir] => E:/HUBLOG/original\n    [hugo_theme] => 311\n)\n, referer: http://localhost/cockpit-master/hugo
[Thu Dec 14 11:21:23.301907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] BASE DIR E:/HUBLOG/original, referer: http://localhost/cockpit-master/hugo
[Thu Dec 14 11:21:23.301907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] LANGUAGES Array\n(\n    [0] => default\n)\n, referer: http://localhost/cockpit-master/hugo
[Thu Dec 14 11:21:23.305902 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] Running cd E:/HUBLOG/original ;hugo -t 311 --cleanDestinationDir --canonifyURLs --config="E:/HUBLOG/original/config.toml", referer: http://localhost/cockpit-master/hugo
The filename, directory name, or volume label syntax is incorrect.
[Thu Dec 14 11:21:23.339907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] CMD OUT .1., referer: http://localhost/cockpit-master/hugo
[Thu Dec 14 11:21:23.339907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] ERROR .., referer: http://localhost/cockpit-master/hugo
[Thu Dec 14 11:21:23.339907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] Returning error 1,  -- Array\n(\n)\n, referer: http://localhost/cockpit-master/hugo

the hugo folder set in a different directory and folder
the cockpit in C;\xampp and hugo in E:\

The generate button is working, but not with RUn Hugo

zontarian commented 6 years ago

Ok But that’s not what I meant. Could you show me the hugo cockpit setting as seen from the plugin? There should be the explicit path to Hugo binary.. Regards

Walter Gamba walter@iakta.it +39 348 5610576 Iakta srl Via A. Da Montefeltro 2 10134 Torino - Italy

On 14 Dec 2017, at 05:32, yudyananda notifications@github.com wrote:

Hi thanks for the response

I managed to run Hugo without cockpit, so i assume that the binary is configured correctly

[Thu Dec 14 11:21:17.837414 2017] [php7:notice] [pid 13084:tid 1892] [client 127.0.0.1:10408] Creating hugo file C:\xampp\htdocs\cockpit-master\addons\Hugo/config.yaml, referer: http://localhost/cockpit-master/ [Thu Dec 14 11:21:19.236443 2017] [php7:notice] [pid 13084:tid 1920] [client 127.0.0.1:10414] Config file is Array\n(\n [hugo_script] => hugo\n [hugo_conf_prefix] => config\n [hugo_conf_extension] => toml\n [cockpit_storage_prefix] => /storage/hugo\n [hugo_extra_params] => --cleanDestinationDir --canonifyURLs\n [hugo_base_dir] => E:/HUBLOG/original\n [hugo_theme] => 311\n)\n, referer: http://localhost/cockpit-master/hugo [Thu Dec 14 11:21:23.300907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] RUNNING HUGO! theme 311 and env prod, referer: http://localhost/cockpit-master/hugo [Thu Dec 14 11:21:23.301907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] Config file is Array\n(\n [hugo_script] => hugo\n [hugo_conf_prefix] => config\n [hugo_conf_extension] => toml\n [cockpit_storage_prefix] => /storage/hugo\n [hugo_extra_params] => --cleanDestinationDir --canonifyURLs\n [hugo_base_dir] => E:/HUBLOG/original\n [hugo_theme] => 311\n)\n, referer: http://localhost/cockpit-master/hugo [Thu Dec 14 11:21:23.301907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] BASE DIR E:/HUBLOG/original, referer: http://localhost/cockpit-master/hugo [Thu Dec 14 11:21:23.301907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] LANGUAGES Array\n(\n [0] => default\n)\n, referer: http://localhost/cockpit-master/hugo [Thu Dec 14 11:21:23.305902 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] Running cd E:/HUBLOG/original ;hugo -t 311 --cleanDestinationDir --canonifyURLs --config="E:/HUBLOG/original/config.toml", referer: http://localhost/cockpit-master/hugo The filename, directory name, or volume label syntax is incorrect. [Thu Dec 14 11:21:23.339907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] CMD OUT .1., referer: http://localhost/cockpit-master/hugo [Thu Dec 14 11:21:23.339907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] ERROR .., referer: http://localhost/cockpit-master/hugo [Thu Dec 14 11:21:23.339907 2017] [php7:notice] [pid 13084:tid 1900] [client 127.0.0.1:10415] Returning error 1, -- Array\n(\n)\n, referer: http://localhost/cockpit-master/hugo the hugo folder set in a different directory and folder the cockpit in C;\xampp and hugo in E:\

The generate button is working, but not with RUn Hugo

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

yudyananda commented 6 years ago

Sorry, do you mean this >> addons\Hugo/config.yaml, it is empty

if you dont mind, can you give me example how to add the configuration on yaml file?

key default use
hugo_script hugo path to the hugo binary
hugo_conf_prefix config base name of hugo config file
hugo_conf_extension toml extension of hugo config file
hugo_base_dir   full path of base Hugo installation dir, where content, config and public dir resides
hugo_theme   theme used to generate Hugo site
cockpit_storage_prefix /storage/hugo prefix of Hugo specific subdir of the root finder
hugo_extra_params --cleanDestinationDir any parameter you want to be passed to hugo while generating a site

Regards

zontarian commented 6 years ago

This is my sample config.yaml file in the Hugo addon directory:

# Cockpit-hugo config settings

has_staging: true
hugo_script: hugo
hugo_conf_prefix: config
hugo_conf_extension: toml
cockpit_storage_prefix: /storage/hugo
hugo_extra_params: --cleanDestinationDir --canonifyURLs
hugo_base_dir: /Users/me/web/sites/iakta.org/hugo/
hugo_theme: iakta-org-bleak
frankjonen commented 5 years ago

Going through my Apache logs, the issue that I had was --canonifyURLs. That doesn't exist in Hugo anymore. It apparently got moved into the Hugo project config file. If you did all the above and it still didn't go through. Remove that and it'll most likely work.

jasonday commented 5 years ago

Same issue here, but removing canonifyURLS did not fix it for me.