Puppet syncing dir - directory

Still does not work
In/etc/puppet/manifests/site.pp
file { "/home/render/installation/":
ensure => "directory",
owner => "render",
group => "render",
recurse => "true",
mode => "0750",
source => "puppet:///files/installation/",
}
Dir still is empty on client
ls /etc/puppet/files/installation/
1 2 3 4 5
On puppet client in log
Mar 21 12:28:12 lw-003 puppet-agent[28098]: (/File[/home/render/installation/]) Failed to generate additional resources using 'eval_generate: Error 400 on SERVER: Not authorized to call search on /file_metadata/files/installation with {:checksum_type=>"md5", :recurse=>true, :links=>"manage"}
Mar 21 12:28:12 lw-003 puppet-agent[28098]: (/File[/home/render/installation/]) Could not evaluate: Error 400 on SERVER: Not authorized to call find on /file_metadata/files/installation Could not retrieve file metadata for puppet:///files/installation: Error 400 on SERVER: Not authorized to call find on /file_metadata/files/installation
Mar 21 12:28:12 lw-003 puppet-agent[28098]: Finished catalog run in 0.28 seconds

I had the same issue and found this question on Google. I had to change the path to the files for the manifests (modulename/manifests/init.pp):
"puppet:///files/installation/",
to:
"puppet:///modules/files/installation/",
The notation without /modules/ was deprecated in 2.7 and no longer supported in newer versions:
DEPRECATION NOTICE: Files found in modules without specifying 'modules' in file path will be deprecated in the next major release. Please fix module 'modulename' when no 0.24.x clients are present

try this example,
file {
"/scratch/usern/testmod" :
ensure => directory,
source => "puppet:///files/testmod",
recurse => true,
owner => "usern",
group => "groupn",
mode => "0775",
backup => false,
}
You have to specify 'files' and if you are doing a recursive copy, specify 'recurse => true'. That might be the solution to your problem.
the 'fileserver.conf' should look something like the following :
]# cat /etc/puppet/fileserver.conf
[files]
path /etc/puppet/files
allow *

Related

Nuke Build Pack 'conflicting assets with same path' exception

this is my first question. I'm new to Nuke and am using it to automate my solution build. I'm packing my solution and getting an error 1 of my 3 projects. I'm trying to pack the nuget packages of my WebAssembly project after compiling in the Build.cs file using:
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
[Solution(GenerateProjects = true)] readonly Solution Solution;
AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
Target Pack => _ => _
.DependsOn(Compile)
.Executes(() =>
{
DotNetPack(s => s
.SetProject(Solution.BookStoreApp_Blazor_WebAssembly_UI)
.SetOutputDirectory(ArtifactsDirectory)
.SetIncludeSymbols(true)
.SetConfiguration(Configuration)
.EnableNoRestore()
.EnableNoBuild());
});
But I get this the error:
[ERR] Pack: C:\Program Files\dotnet\sdk\6.0.300\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(907,5): error : Conflicting assets with the same path '/wwwroot/service-worker-assets.js' for content root paths 'C:\Users\patob\source\repos\BookStoreApp\BookStoreApp.Blazor.WebAssembly.UI\obj\Debug\net6.0\service-worker-assets.js.build' and 'C:\Users\patob\source\repos\BookStoreApp\BookStoreApp.Blazor.WebAssembly.UI\obj\Debug\net6.0\service-worker-assets.js'. [C:\Users\patob\source\repos\BookStoreApp\BookStoreApp.Blazor.WebAssembly.UI\BookStoreApp.Blazor.WebAssembly.UI.csproj]
I'm not sure how to fix this issue, I've tried deleting the 'service-worker-assets.js.build' file but it doesn't fix the problem. I would love some help.
Thanks

Fatal error within Woocommerce "wc-template-functions.php" file

I have tried to edit wc-template-functions.php in my store and did something wrong.
Now I am getting Fatal Error on 281 line.
Fatal error: Uncaught Error: Class 'Constants' not found in /home/kidsandm/oliverthedog/wp-content/plugins/woocommerce/includes/wc-template-functions.php:282 Stack trace: #0 /home/kidsandm/oliverthedog/wp-includes/class-wp-hook.php(292): wc_generator_tag('<meta name="gen...', 'xhtml') #1 /home/kidsandm/oliverthedog/wp-includes/plugin.php(212): WP_Hook->apply_filters('<meta name="gen...', Array) #2 /home/kidsandm/oliverthedog/wp-includes/general-template.php(4728): apply_filters('get_the_generat...', '<meta name="gen...', 'xhtml') #3 /home/kidsandm/oliverthedog/wp-includes/general-template.php(4650): get_the_generator('xhtml') #4 /home/kidsandm/oliverthedog/wp-includes/general-template.php(4627): the_generator('xhtml') #5 /home/kidsandm/oliverthedog/wp-includes/class-wp-hook.php(292): wp_generator('') #6 /home/kidsandm/oliverthedog/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array) #7 /home/kidsandm/oliverthedog/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #8 /home/kidsandm/oliverthedog/wp-includes/gen in /home/kidsandm/oliverthedog/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 282
Before that I also had warning at the top that said:
Warning: The use statement with non-compound name 'AutomatticJetpackConstants' has no effect in /home/kidsandm/hondamarine/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 11
but I have hide that line thinking it might help.
What I have change in file?
Additional information.
I was thinking it will change the name of it on front-end as well.
// Additional information tab - shows attributes.
if ( $product && ( $product->has_attributes() || apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) ) {
$tabs['additional_information'] = array(
'title' => __( 'Additional information', 'woocommerce' ),
'priority' => 20,
'callback' => 'woocommerce_product_additional_information_tab',
);
}
Line 1798.
I have tried to find a code only to replace it, and I found one but did not help.
Now, that code might not be original because I could not find it on GitHub.
Thanks a lot!
It just happened to me too, I tried to edit the code for the same reason, I searched a lot about this problem and I solved it when I downloaded the plugin in zip form and manually upload it and install it, now its working fine for me and all data still in place (categories, products, etc.)!
I had the following 2 errors:
Fatal Error: Uncaught error: Class 'Constants' not found in /Users/anastasiades/Local Sites/pisinaspa/app/public/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 282
Error: Class 'Constants' not found in /Users/anastasiades/Local Sites/pisinaspa/app/public/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 282
Steps:
1. Backup data in woocommerce
2. Download plugin here
3. On WordPress go to Plugins >> Add new >> Upload plugin
4. Choose Reinstall >> Install now
5. "Replace current with uploaded"
I recommend a good backup of the products and other data before doing this.
Peace!

Symfony cloud MPDF temp files can't be stored in /tmp

Our project is going to be on Linux, and we want to have the temp files be stored in /tmp/mpdf. I have the following MPDF constructor:
$mpdf = new Mpdf(['mode' => 'en',
'default_font_size' => 8,
'margin_left' => 9.5,
'margin_right' => 0,
'margin_bottom' => 37,
'margin_header' => 0,
'margin_footer' => 2,
'fontDir' => array_merge((new ConfigVariables())->getDefaults()['fontDir'], [realpath(getenv('DOCUMENT_ROOT')) . '/../assets/fonts']),
'fontdata' => (new FontVariables())->getDefaults()['fontdata'] + [
'arialuni' => [
'R' => 'arialuni.ttf',
'B' => 'arialuni.ttf'
]
],
'tempDir' => sys_get_temp_dir()
]);
However, I end up getting the following error:
"[prod] Feb 26 10:40:30 |CRITICA| REQUES Uncaught PHP Exception Mpdf\MpdfException: "Temporary files directory "/app/vendor/mpdf/mpdf/src/Config/../../tmp/mpdf" is not writable" at /app/vendor/mpdf/mpdf/src/Cache.php line 21"
From what I understand, it still tries to use the following folder:
/app/vendor/mpdf/mpdf/tmp/mpdf
It should however use the /tmp folder which was recommended by the symfony cloud support (the /tmp folder of Linux)
So I had the same issue recently and it is caused by the Mpdf library not having enough permission to write to the vendors folder, (which frankly it shouldn't have).
The solution for me was to update the tmp_dir in ConfigVariables.php to use PHP's temp dir instead of the one it tries to use.
Made a fork => https://packagist.org/packages/tevli/mpdf
Github => https://github.com/tevli/mpdf

Drush 9 sql:sync error: no database record could be found for source #local

I just installed a new Drupal 8 and it comes with Drush 9, and I was trying to set up everything to use the command sql:sync or config:pull to have my local and staging syncronized but everytime I run the command 'drush sql:sync #local #stage' I get the following error
In SqlSyncCommands.php line 86:
[Exception] Error: no database record could be found for source
#local
Here's my self.site.yml
local:
host: localhost
user: root
root: /var/www/html/new-drupal
uri: http://new-drupal.local
stage:
host: XX.XX.XX.XX
user: root
root: /var/www/html/new-drupal
uri: http://new-drupal.my-staging.com
Searching around I found old versions of the aliases file that included this option:
'databases' =>
array (
'default' =>
array (
'default' =>
array (
'driver' => 'mysql',
'username' => 'sqlusername',
'password' => 'sqlpassword',
'port' => '',
'host' => 'localhost',
'database' => 'sqldbname',
),
),
),
But checking the example file of the 9 version there's nothing about it: https://github.com/drush-ops/drush/blob/master/examples/example.site.yml
Did someone had the same problem and found a solution?
It's been a while since my conversion. I had similar issues and went with a least-configuration approach.
First, compare the results of the following commands to see if it exposes any problems:
drush site:alias
drush site:alias #self
drush site:alias #local
I don't have a self.site.yml file. I've named mine drush/sites/remote.site.yml and only have remote aliases in it. I do not define a #local alias and use the built-in #self alias instead.
In drush/drush.yml I have:
drush:
paths:
config:
- ../docroot/sites/default/local.drush.yml
In docroot/sites/default/local.drush.yml I only have
options:
uri: 'http://localhost:port'
With this configuration the results of drush site:alias #self is
'#self':
root: /var/www/docroot
uri: 'http://localhost:port'
And assuming I have a valid #stage alias in drush/sites/remote.site.yml I would just run
drush sql:sync #self #stage
If you want a #local alias maybe you should move it over to the local drush config instead.

How to solve Twig_Error_Runtime in Symfony 3

I have inherited a rather complicated Symfony 3 project (I'm using Laravel mostly nowadays - it's been years since I used Symfony) so this is a bit out of my wheelhouse.
I did a composer update and it built ok.
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Updating twig/twig 1.x-dev (e8555dc => 1445246): Checking out 1445246d8e
Writing lock file
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
// Clearing the cache for the dev environment with debug
// true
[OK] Cache for the "dev" environment (debug=true) was successfully cleared.
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets
Trying to install assets as relative symbolic links.
-- -------- ----------------
Bundle Method / Error
-- -------- ----------------
[OK] All assets were successfully installed.
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget
I cleared the cache
php bin/console cache:clear --no-warmup --env local
When I browse to my local development URL, I get:
Whoops, looks like something went wrong.
(4/4) Twig_Error_Runtime
An exception has been thrown during the rendering of a template ("Notice: Undefined offset: 0").
in exception_full.html.twig (line 1)
at Twig_Template->displayWithErrorHandling(array('status_code' => 500, 'status_text' => 'Internal Server Error', 'exception' => object(FlattenException), 'logger' => object(Logger), 'currentContent' => '', 'app' => object(AppVariable)), array('head' => array(object(__TwigTemplate_ed2c7b0206a4a8ba0c01ceb7e7a7f0ba342d3cbf55c912fe1f34e6abd35411c0), 'block_head'), 'title' => array(object(__TwigTemplate_ed2c7b0206a4a8ba0c01ceb7e7a7f0ba342d3cbf55c912fe1f34e6abd35411c0), 'block_title'), 'body' => array(object(__TwigTemplate_ed2c7b0206a4a8ba0c01ceb7e7a7f0ba342d3cbf55c912fe1f34e6abd35411c0), 'block_body')))
in Template.php (line 403)
<snip/>
(3/4) ContextErrorException
Notice: Undefined offset: 0
in Profiler.php (line 23)
at Twig_Extension_Profiler->enter(object(Twig_Profiler_Profile))
in ProfilerExtension.php (line 40)
<snip/>
(2/4) Twig_Error_Runtime
An exception has been thrown during the rendering of a template ("Notice: Undefined offset: 0").
in base.html.twig (line 11)
at Twig_Template->displayBlock('javascripts', array('env' => 'local', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_e199b3b21ccad34239564ea288dce2bfa2f11212622c2c75863848c603e82b70), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_e199b3b21ccad34239564ea288dce2bfa2f11212622c2c75863848c603e82b70), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_888836406c51f4232014f646f747310c541800b61ef418c11fbfcee42a1afe9b), 'block_body'), 'javascripts' => array(object(__TwigTemplate_e199b3b21ccad34239564ea288dce2bfa2f11212622c2c75863848c603e82b70), 'block_javascripts')))
in Environment.php(467) : eval()'d code (line 51)
<snip/>
(1/4) ContextErrorException
Notice: Undefined offset: 0
in Profiler.php (line 23)
at Twig_Extension_Profiler->enter(object(Twig_Profiler_Profile))
in ProfilerExtension.php (line 40)
Since this appears to be an issue with vendor files, I'm not sure where to go from here.
The last error in the logs is
[2018-03-02 15:56:53] request.CRITICAL: Exception thrown when handling an exception (Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Notice: Undefined offset: 0"). at /Projects/myproject/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig line 1) {"exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"Notice: Undefined offset: 0\"). at /Projects/myproject/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig:1, Symfony\\Component\\Debug\\Exception\\ContextErrorException(code: 0): Notice: Undefined offset: 0 at /Projects/myproject/vendor/twig/twig/lib/Twig/Extension/Profiler.php:23)"} []
Try to add this line in composer.json
"twig/twig": "2.4.4"
For me worked.
It seems the last updates for twig 2.4.5 had this problem.
I found the answer here:
https://github.com/twigphp/Twig/issues/2627

Resources