Invalid parameter elasticsearch_package_name on Elasticsearch_plugin - elasticsearch

OS : 'CentOS 6.5
'
ElasticSearch version : '2.3.0'
Master's puppet version: '3.8.7'
Client's puppet version : '3.7.4'
Base module version before upgrade : '0.10.2'
Base module version after upgrade : '5.1.0'
Error: could not retrieve catalog from remote server: Error 400 on
SERVER: invalid parameter elasticsearch_package_name on
Elasticsearch_plugin[license] at
/etc/puppet/environments/production/modules/elasticsearch/manifests/plugin.pp:169
on node bla-test01.dom'
Hi,
This error started after we upgraded our Elasticsearch's base (Official from puppet forge) module from version '0.10.2' to '5.1.0'. Our puppet module of elasticsearch worked just fine before the upgrade.
Since the upgrade this error occurred whenever puppet ran on our nodes.
After we saw this case we tried to restart our puppetserver service. Since the restart, the error occurs once every 3-4 runs of puppet and we have no idea why.

Looking at the elastic/elasticsearch module which is the one you seem to be using i can see that the elastic_plugin custom type did not have the elasticsearch_package_name parameter in version 0.11.0 however the 5.1.0 version does. This looks to me that you may have updated the module on the system but have not restarted the puppet server so it still has the 0.11.0 custom type/provider ruby files loaded.
Restart the puppet master server and see if that fixes the issue

Related

Unable to execute PHPUnit Tests in Adobe Commerce (Magento 2)

I’m running a local Docker instance of Adobe Commerce (Magento 2) with the following versions:
Magento Enterprise version 2.4.3-p3
phpunit/phpunit version 9.5.28
doctrine/annotations version 2.0.0
allure-framework/allure-php-api version 1.4.0
I’m unable to run PHPUnit tests in PhpStorm (Build #PS-223.8214.64)
The error I’m getting is the following:
Call to undefined method Doctrine\Common\Annotations\AnnotationRegistry::registerUniqueLoader()
Searching for registerUniqueLoader in the vendor directory, I’m seeing the following in Yandex\Allure\Adapter\Annotation\AnnotationProvider:: registerAnnotationNamespaces()
public static function registerAnnotationNamespaces()
{
AnnotationRegistry::registerUniqueLoader('class_exists');
}
However, class Doctrine\Common\Annotations\AnnotationRegistry only has methods reset() and loadAnnotationClass().
Is there a set of module versions I need to be at in order to be able to run PHPUnit tests? Thanks in advance for the help.
Try to change doctrine/annotations version to 1.14.2 in composer.json. It works for me.

Ruby on Rail running apache show index of when accessing the site

I have recently updated to Apache 2.4, and I am using Ruby on Rail to run my application. Following the upgrade, the site shows a content as seen in the image below, and the error on the log file shows this error message. I have tried using the 'Bundle Install' and checked the permission but that hasn't helped. Any advice would be greatly appreciated. Thanks
[ 2022-02-07 07:47:24.5559 8104/7efc89c8f700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/adminuser/hroot: An error occured while starting up the preloader.
Error ID: ba7e6074
Error details saved to: /tmp/passenger-error-RA01E9.html
Message from application: libmysqlclient.so.18: cannot open shared object file: No such file or directory - /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/gems/mysql2-0.3.14/lib/mysql2/mysql2.so (LoadError)
PassengerRuby /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/wrappers/ruby
SetEnv GEM_HOME /root/.gem/ruby/1.9.1
This error shows a problem with the shared objects. You probably updated MySQL/MariaDB libraries with Apache and new libraries are incompatible with your mysql2 gem build. The solution is simple:
First, ensure you are using the ruby-2.0.0-p353#hroot RVM environment.
Then, execute the following command:
gem install mysql2 --version 0.3.14
This should rebuild your mysql2 gem for the new MySQL/MariaDB client libraries on your system.
this isn't the answer anyway but another method to run ruby (in my case Windows 10 ; if you use another OS try to find out how to modify inside index.php the ruby starter)
i post here an alternative method to use apache + php +... and ruby
https://stackoverflow.com/a/71733656/5781320

Elasticsearch 7.3 upgrade with homebrew

I was using Elasticsearch 6.8 via homebrew, and I was trying to upgrade to 7.3. Previously, on 6.8 I already got a warning about a log file that did not exist, but the server would still run - so I did nothing.
Now with 7.3, I get an error and the server won’t run:
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
[0.002s][error][logging] Error opening log file 'logs/gc.log': No such file or directory
[0.002s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=32,filesize=64m' failed.
error:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:111)
at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:79)
at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:57)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:89)
I tried creating the dir/file where elasticsearch was installed, but that did not work for me (or i did something wrong).
Reference: https://onecompiler.com/questions/3uwszcf3x/homebrew-installed-elasticsearch-failing-to-start
I have fixed this by changing the relative logs/gc.log path to an absolute path. Follow the below steps to solve the issue
Open jvm.options file which is located at /usr/local/etc/elasticsearch/jvm.options
Change the relative path to an absolute path
from the following
# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
to
# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/usr/local/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m
Restart elasticsearch $ brew services restart elasticsearch-full or just start it without daemon - $ elasticsearch

Package for java not being picked up by Chef even when specifying a valid version

I am bumping my head due to an error occurring in Chef 13 while trying to spawn a centos/6 image on a vagrant 2.0.2 box.
My task is quite basic: I am trying to install java-openjdk with version 1.8.0 and I am using the yum_package as follows:
yum_package "java" do
flush_cache [ :before ]
arch 'x86_64'
version "java-1.8.0-openjdk"
action :install
end
And here's the catch:
If I don't specify the version, I will get java-openjdk 1.5.0.
When I specify the version, as shown in the code above, I will get that "no candidate version available for java".
When I try to state a version >= by doing
yum_package "java > java-1.8.0-openjdk" do
I will get that many options are available and yum installs java 1.5 since it is the first one it found (which sounds a bit surprising):
WARN: yum_package[java >= java-1.8.0-openjdk-1.8.0.161-3.b14.el6_9] matched multiple Provides for java >= java-1.8.0-openjdk-1.8.0.161-3.b14.el6_9 but we can only use the first match: java-1.5.0-gcj. Please use a more specific version.
I have even gone to the extent of setting the version to the full name of the file: java-1.8.0-openjdk-1.8.0.161-3.b14.el6_9.x86_64 which is listed as a valid version once I go inside the vagrant box and do a --show-duplicates from yum:
yum search --showduplicates java-1.8.0-openjdk
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirror.hmc.edu
* epel: mirror.compevo.com
* extras: mirror.texas3006.com
* updates: centos.mirror.lstn.net
===================================================================== N/S Matched: java-1.8.0-openjdk ======================================================================
1:java-1.8.0-openjdk-1.8.0.121-1.b13.el6.x86_64 : OpenJDK Runtime Environment
1:java-1.8.0-openjdk-1.8.0.131-0.b11.el6_9.x86_64 : OpenJDK Runtime Environment
1:java-1.8.0-openjdk-1.8.0.141-2.b16.el6_9.x86_64 : OpenJDK Runtime Environment
1:java-1.8.0-openjdk-1.8.0.141-3.b16.el6_9.x86_64 : OpenJDK Runtime Environment
1:java-1.8.0-openjdk-1.8.0.144-0.b01.el6_9.x86_64 : OpenJDK Runtime Environment
1:java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64 : OpenJDK Runtime Environment
1:java-1.8.0-openjdk-1.8.0.161-3.b14.el6_9.x86_64 : OpenJDK Runtime Environment
Even more strangely, once I go inside the box I can easily install java jdk by just running yum install java, it will pick up correctly java 1.8.0:
root#localhost vagrant]# yum install java
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.mirror.ca.planethoster.net
* epel: ftp.cse.buffalo.edu
* extras: mirror2.evolution-host.com
* updates: centos.mirror.ca.planethoster.net
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-openjdk.x86_64 1:1.8.0.161-3.b14.el6_9 will be installed
My question is: is Chef somehow running a different repo to the one I actually have on the machine? Why my cmd within the box shows different java versions to the one Chef is using?
So first we need to rewind a bit and work out what is the package name vs. version. Taking 1:java-1.8.0-openjdk-1.8.0.121-1.b13.el6.x86_64 : OpenJDK Runtime Environment as the example, the package name is java-1.8.0-openjdk and the version is 1:1.8.0.121-1.b13.el6.x86_64, more commonly just given as 1.8.0.121-1.b13. There is no package actually called java, it's a magic-y alias within Yum to do the right thing, but the alias confuses Chef since we query the package info database directly.
So what you want is more like this:
package 'java-1.8.0-openjdk' do
version '1.8.0.121-1.b13'
end
or something similar.

Installing puppetlabs/apt fails with '302 Found'

So I have a vagrant / puppet setup for my project* and am running Ubuntu 14.04 on it. It just broke, without changing anything. puppet module install puppetlabs-apt inside the VM fails with the following lines:
Error: Could not execute operation for 'puppetlabs/apt'
The server being queried was https://forge.puppetlabs.com
The HTTP response we received was '302 Found'
Check the author and module names are correct.
I'm using this module for quite some time and it seems like it just stopped working for no reason. Any advice appreciated.
-- Edit: answer question
running it with --debug doesn't help much I guess
Notice: Preparing to install into /home/vagrant/.puppet/modules ...
Notice: Created target directory /home/vagrant/.puppet/modules
Notice: Downloading from https://forge.puppetlabs.com ...
Error: Could not execute operation for 'puppetlabs/apt'
The server being queried was https://forge.puppetlabs.com
The HTTP response we received was '302 Found'
Check the author and module names are correct.
*Link: https://github.com/dwalldorf/owTracker
vagrant up / vagrant ssh and puppet module install puppetlabs-apt
This should be fixed. You can check FORGE-327 for more information
https://forge.puppetlabs.com/puppetlabs/apt redirect to https://forge.puppet.com/puppetlabs/apt
you can force it to use the correct forge by appending --module_repository https://forge.puppet.com/ so it will become
puppet module install puppetlabs-apt --module_repository https://forge.puppet.com/
not sure exactly why it wants to download from https://forge.puppetlabs.com at first place, you could check your puppet.conf

Resources