blogdown::serve_site() fails to produce template site - r

I've been following the instructions here to install the R blogdown package and get my new site running. When I get to the step where I run serve_site(), I get the following error message:
Launching the server via the command:
C:/Users/xxxxx/AppData/Roaming/Hugo/0.91.0/hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t starter-hugo-academic -D -F --navigateToChanged
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: book/single.html:5:3: executing "book/single.html" at <partial "site_head" .>: error calling partial: "C:\Users\em14031\OneDrive - AUT University\Personal_website\themes\github.com\wowchemy\wowchemy-hugo-modules\wowchemy\v5\layouts\partials\site_head.html:208:13": execute of template failed: template: partials/site_head.html:208:13: executing "partials/site_head.html" at <getenv "WC_POST_CSS">: error calling getenv: access denied: "WC_POST_CSS" is not whitelisted in policy "security.funcs.getenv"; the current security configuration is:
[security]
enableInlineShortcodes = false
[security.exec]
allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']
osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']
[security.funcs]
getenv = ['^HUGO_']
[security.http]
methods = ['(?i)GET|POST']
urls = ['.*']
So it looks like there's some security config file that needs editing, however I can't find it in '~/config/_default' within the project. Any ideas where this file could be?
Thanks a lot!

The config file is config/_default/config.yaml in your website project. Add
security:
funcs:
getenv:
- ^HUGO_
- ^WC_
to it to whitelist the environment variable WC_POST_CSS.

Related

Error building webpage: RStudio + blogdown + Ezhil Theme

I am new to blogdown/hugo themes and want to build a webpage using the Ezhil theme with RStudio. I am following the instructions of blogdown.
In particular, after creating the project on RStudio, I am not able to build/serve the site. If I run serve_site(), I obtain
> blogdown::serve_site()
Launching the server via the command:
/Users/brunoconteleite/Library/Application Support/Hugo/0.84.2/hugo server --bind 127.0.0.1 -p 4321 --themesDir themes -t ezhil -D -F --navigateToChanged
Error: Error building site: logged 1 error(s)
Instead, if I run hugo_build(), I obtain
> blogdown::hugo_build()
Start building sites …
hugo v0.84.2-E0C67958+extended darwin/amd64 BuildDate=2021-06-28T10:59:21Z VendorInfo=gohugoio
ERROR 2021/06/29 13:20:37 instagram shortcode: Missing config value for services.instagram.accessToken. This can be set in config.toml, but it is recommended to configure this via the HUGO_SERVICES_INSTAGRAM_ACCESSTOKEN OS environment variable. If you are using a Client Access Token, remember that you must combine it with your App ID using a pipe symbol (<APPID>|<CLIENTTOKEN>) otherwise the request will fail.
If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config:
ignoreErrors = ["error-missing-instagram-accesstoken"]
Total in 40 ms
Error: Error building site: logged 1 error(s)
I tried to add the suggested ignoreErrors = ["error-missing-instagram-accesstoken"] line of code to the config.yalm file but could not address this issue.
You need to turn the TOML code into YAML if your config file has yaml or yml extension.
So, rather than ignoreErrors = ["error-missing-instagram-accesstoken"], add ignoreErrors: "error-missing-instagram-accesstoken" line to your config.yaml file. It should work.

Error KnpSnappyBundle / wkhtml - ConnectionRefusedError

I have an incomprehensible problem.
I have used this bundle many times, and I understand the main logic to generate a pdf from a twig view.
But on my two last project i have this kind of error:
Error: Failed to load https://mydomain/bundles/bundle/css/bootstrap.css, with network status code 1 and http status code 0 - Connection refused
Exit with code 1 due to network error: ConnectionRefusedError
I have tried:
HTTP and HTTPS url
chmod 777 on var/cache folder - try acl
disable all parameters of wkhtml
update wkhtml
Disable extends twig view - ihave made a new file with full HTML
Clean controller use assets
filter / absolute_url filter / or web_url variable to prefix assets
On my development environment (Windows), i didn't have any problem.
This problem appeared when I work on production environment, based on Debian 9 with nginx, php 5.6, mariadb 10.0* and letsencrypt certificate.
I can't load any assets for now.
Does anyone have an idea??
Ok i have found a workaround. I use this trick :
create a global variable with this path :
pdf_url: '%kernel.root_dir%/../web'
then i call my assets like this :
<link href="{{ pdf_url}}/bundles/css/bootstrap.css" rel="stylesheet">
Its a not the ebst solution, but its works.

Issue with custome moduel installation in Sulu Admin

I have integrated the Example module in my Sulu-standard installation. The code I used for the example module is from following repository :
https://github.com/sulu/ExampleNewsBundle
And the steps I followed for integration are from this
http://blog.sulu.io/how-to-develop-a-bundle-in-the-sulu-admin-1
After the installation I am getting this error while loading the JS for the module :
"NetworkError: 404 Not Found - http://beauty_dev.com/en/bundles/examplenews/js/main.js?v=develop"
Error: Script error for: /bundles/examplenews/js/main.js http://requirejs.org/docs/errors.html#scripterror
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
Error: Script error for: /bundles/examplenews/js/main.js http://requirejs.org/docs/errors.html#scripterror
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
After some research I found that 404 error was due to locale(en) appended in the URL.
Is it possible to remove the locale from the URL?
Any reference will be appreciated.
After adding a new bundle you have to reinstall the assets using the following command:
app/console assets:install --symlink
Symfony doesn't do that automatically, so you have to execute this line, in order for the files to be copied to the web directory. You could also check if the accessed file is available in the web directory, which should be the case after executing the above command.
Regarding the language: You see that because Sulu tries to redirect to the default language if the current URL leads to a 404 and doesn't contain a language.
Are you sure that the files in the web/bundles/examplenews folder exists and you can access from the browser? When the files exists and the webserver returns them correctly the /de will not be prepended.

JHipster prod profile Grunt build error on Eclipse

I'm doing an app with JHipster 1.4.0 using Eclipse.
In dev profile, no problem, but when i switched to prod profile, there's an error in build :
Description : Plugin execution not covered by lifecycle configuration: com.github.trecloux:yeoman-maven-plugin:0.2:build (execution: run-grunt, phase: generate-resources)
Resource : pom.xml
Path : /myapp
Location : line 444
Type : Maven Project Build Lifecycle Mapping Problem
I'm new to Eclipse and i didn't find a solution on forums. If someone can help...
Thanks !
I just had a same issue, and this was because I had another process using the same port number as Grunt (port 9001).
Can you check your Grunt error message? I had:
Running "connect:test" (connect) task
Fatal error: Port 9001 is already in use by another process.

Drush install on local server error (Command pm-enable needs a higher bootstrap level)

I am getting an error message in Drush on a local mamp install
PDO::__construct(): [2002] Connection refused (trying to connect via tcp://127.0.0.1:3306) [warning]
environment.inc:517
Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more [error]
functional Drupal environment to run this command.
The drush command 'en devel' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a configured database. In this case
you can select another site with a working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for details.
* connect the database through a socket. The socket file may be wrong or the php-cli may have no
access to it in a jailed shell. See http://drupal.org/node/1428638 for details.
Drush was attempting to connect to:
Drupal version : 7.21
Site URI : http://default
Database driver : mysql
Database hostname : 127.0.0.1
Database username : root
Database name : geoslate
Default theme : garland
Administration theme: garland
PHP configuration : /private/etc/php.ini
Drush version : 5.8
Drush configuration:
Drupal root : /Applications/MAMP/htdocs/geoslate
Site path : sites/default
Modules path : sites/all/modules
Themes path : sites/all/themes
File directory path: sites/default/files
%paths : Array
my drupal settings needed a port specifying which is on the MAMP home page and for me is 8889

Resources