pe_upgrade based module not being applied - upgrade

OS: Oracle Linux (hey, I'd have preferred CentOS)
Puppet Enterprise 3.3.0 with puppetlabs-stdlib (v4.3.2)
The puppetlabs-pe_upgrade module should allow me to update the puppet enterprise client software on my target nodes, so I wrote this module.
It lives in /etc/puppetlabs/puppet/modules/eeep_upgrade and all it's files are owned by root:pe-puppet. For some reason, the module is apparently not being added to the catalog during runs. I ran 'puppet agent -t --debug' and nothing is executed nor are errors generated. 'puppet parser validate' and puppet-lint and neither found any errors. I probably have an extra colon somewhere.
class { '::pe_upgrade:eeep_pupgrade':
version => '3.6.2',
answersfile => 'pe/answers/agent.txt.erb',
download_dir => 'puppet:///eeep_pupgrade/files/pe/3.6.2',
timeout => '3600',
}

Related

Wildfly Management CLI Configuration

I've been finding ways to load configuration to wildfly in bulk (say I have a json data).
Something that kind of look like this.
./jboss-cli.sh -c subsystem=messagingactivemq/server=default:add(<data.json>)
Where <data.json>
{
"outcome" => "success",
"result" => {
"address-full-policy" => "BLOCK",
"dead-letter-address" => "jms.queue.DLQ",
"expiry-address" => "jms.queue.ExpiryQueue",
"last-value-queue" => false,
"max-delivery-attempts" => 10,
"max-size-bytes" => 12333,
"message-counter-history-day-limit" => 10,
"page-max-cache-size" => 5,
"page-size-bytes" => 12333,
"redelivery-delay" => 0,
"redistribution-delay" => 222L,
"send-to-dla-on-no-route" => false
}
}
I want to load the above json directly to wildlfy via jboss-cli. Is this even possible? i have been looking for references about this for the past weeks. Any inputs are welcome.
EDITED
Just to be clear with my goals, I am trying ti migrate manually configured items on jBoss AS7.1 into Wildfly 10.1. Currently migration scripts only supports EAP versions of jBoss. So I have to manually select configurations fron jBoss to be migrated to wildfly. Yes, there are configuration that are deprecated and/or deleted in wildfly, so between jBoss AS7.1 and Wildfly10.1 I have to make some changes to the configuration before I load it to wildfly hence I mentioned the json data.
Since when I try to outputresource in jBoss AS7.1 via jboss-cli.sh using command /subsystem=messaging/hornetq-server=default:read-resource it will output something like
{
"outcome" => "success",
"result" => {
"acceptor" => undefined,
"allow-failback" => true,
"async-connection-execution-enabled" => true,
"backup" => false,
"bridge" => undefined,
"broadcast-group" => undefined,
"cluster-connection" => undefined,
... some resource ....
So I will make some modification on the above data (since wildfly uses activemq) and load it to wildfly as activemq. But it just want to use the json data and load it directly to wildfly's jboss-cli.sh. I want to automate this and just execute a script (shell) to do the migration.
Not entirely sure, what exactly are you trying to achieve here, but if you want to execute bulk operations from file, you can use jboss-cli.sh --file=commands.cli where commands.cli is a text file containing jboss cli commands.
This way you can perform multiple operations at once, plus you can utilize the batch functionality provided by JBoss CLI to make sure all changes are applied or reverted.
Example file with multiple commands:
#Add xa datasource
xa-data-source add \
--name=my.app.ds \
--jndi-name=java:jboss/datasources/my.app.ds \
--driver-name=h2 \
--user-name=username \
--password=password \
--use-java-context=true \
--enabled=true \
--xa-datasource-properties={"URL"=>"jdbc:h2:tcp://${env.DB_HOST:localhost}:${env.DB_PORT:1521}/~/my.app.ds;MVCC=TRUE"}
#Add JMS queue
jms-queue add --queue-address=foo.bar.myapp.queue --entries=java:/jms/queue/foo.bar.myapp.queue
#Add system property
/system-property=ENABLE_MY_COOL_MESSAGING_FEATURE:add(value="true")
If you want to define modules or execute operations based on JSON file or any other format apart from the CLI command format, I am afraid you are out of luck. You can make you own java library that wraps the JBoss CLI to execute it though - as JBoss/Wildfly provides CLI bindings for Java and Python I believe.

Why I get 500 Error while on XAMPP while loading CodeIgniter 3 database library?

I have gone through number of threads on stackoverflow and on other forums to find the answer but could not find relevant answer. People have applied different approaches but none has worked for me thus far.
I am using CI 3 on XAMPP and whenever I load database library in the model, I run into 500 Error.
Here is my CI database config info:
'hostname' => 'localhost',
'username' => 'my_user',
'password' => 'my_pass',
'database' => 'prod_db',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
PHP ini db libraries are as below:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
My model code is as below:
class loginmodel extends CI_Model {
public function validate_login($username, $password) {
$this->load->database();
$var = 0;
return $var;
}
}
Whenever I remove $this->load->database(); from the model, my code runs and i am able to redirect to a "Login Failed" page. BUT, whenever I load my database library in autoload.php or load it in above model, code fails.
Autoload.php
$autoload['libraries'] = array('database');
Apache error logs showed below errors but I could not figure as why this was happening.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_mysqli.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_pdo_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0
Please advise.
EDIT:
I verified all config to be OK and as stated in the comments, I added environment variables to windows and verified through PHPInfo that mysqli and mysqlnd were loaded.
Despite getting all the config right, error still persisted and I did a clean install of CI to reproduce library load failure. This time CI returned an error that db access was denied.
I then realized that after migration, database user was not created in the new environment. So once I created the desired user and assigned it required privileges, I was able to run the code just fine.
Therefore, if anyone encounters such issue in future, below steps might help:
First and foremost, verify if your desired user can access the
database.
Modify your .htaccess to use your desired URL schemes only after
verifying that database connection is working
Then verify that absolute path is available in PHP.ini on XAMPP.
Plus, verify that PHP is added in the environment variables. My
Values on Windows 10 are as follows: Variable Name: PHP , Variable
Value: C:\xampp\php\ext
In CI, mysqli is selected as database driver
In PHP.ini mysqli extension is enabled. i.e. php_mysqli.dll
Echo PHPInfo to verify that mysqli and mysqlnd are available in your
installation.
If nothing works, do a clean install of CI on a separate directory and load database library after setting up your database configuration and before setting up .htaccess until you can reproduce the error.
Hope that error will be eliminated!

Failed to start Neo4j service

I am using neo4j enterprise 3.0.3 version for windows. Following the operations manual 3.0, I have installed the neo4j service with bin\neo4j install-service. But I can't start it with bin\neo4j start. It said
Invoke-Neo4j : Failed to start service 'Neo4j Graph Database - neo4j (neo4j)'.
And I can't start the neo4j service in windows serice either. Maybe anyone have encountered this case before?
I had the same problem: I am using neo4j community 3.1.2 for windows and installed the service with the neo4j.bat file without any problems.Then i wanted to start the service with neo4j.bat and got the same error as you
I found a solution that worked for me. My neo4j files were in a folder, where the path to the folder contained spaces (C:\Program Files\Neo4j) Then i moved the folder one level up (C:\Neo4j).
After that i could start the service without problems.
Maybe this solution helps.
I am running neo4j on windows and in my case the crux of the issue was that there was an incompatibility between the installed versions of Java (32-bit) v/s OS version. The biggest clue that led me to this is the following set of lines in neo4j-service.2018-08-03 log file
[2018-08-03 14:55:42] [info] [ 1432] Starting service...
[2018-08-03 14:55:42] [error] [ 1432] %1 is not a valid Win32 application.
[2018-08-03 14:55:42] [error] [ 1432] Failed creating java C:\JavaNew\bin\server\jvm.dll
[2018-08-03 14:55:42] [error] [ 1432] %1 is not a valid Win32 application.
[2018-08-03 14:55:42] [error] [ 1432] ServiceStart returned 1
There are a fair number of potential issues, and I have made an attempt to compile all the issues with this,
Windows services cannot deal with service names in folders that have spaces; especially if there is another folder with the same name as the one with spaces.
For example - C:\Program Files... will have issues if C:\Program\Something...
To work around this, I put Neo4j in root folder c:\Neo4j
Get-Java.ps1 (under ..\bin\Neo4j-Management folder)looks in the path variable for 'JAVA_HOME' (usually found in *nix environments). If it does not find it here, it keeps looking in registry, and finally throws up its hand!
To deal with this, I simply put in a path variable. For a good measure, I uninstalled Java and re-installed Java in the root folder under C:\JavaNew
In retrospect, this step is probably not on part of the problem, and hence can be ignored. But I am leaving it here for completeness sake.
Invoke-Neo4j.ps1 (also under ..\bin\Neo4j-Management folder) has code that determines if the OS is 32-bit (or 64-bit). Based on this it determines if it should run prunsrv-i386.exe (32-bit) or prunsrv-amd64.exe (64-bit).
This has to match the Java version installed.
Upon running java -XshowSettings:all, and inspecting the sun.arch.data.model value (32, in my case), I realized that my OS is 64 bit and the Java version is 32-bit.
To deal with this, I put in code (very klugey!). I am sure there are much better ways to get to the same outcome, but this is what I used.
switch ( (Get-WMIObject -Class Win32_Processor | Select-Object -First 1).Addresswidth ) {
32 { $PrunSrvName = 'prunsrv-i386.exe' } # 4 Bytes = 32bit
#64 { $PrunSrvName = 'prunsrv-amd64.exe' } # 8 Bytes = 64bit COMMENTED as a workaround!!!
64 { $PrunSrvName = 'prunsrv-i386.exe' } # 8 Bytes = 64bit
Now, uninstall the neo4j service, install it, and start the service.
Hope this works for you.
neo4j console
Posting for latest versions > 4.x
I had the same issue using neo4j start, Neo4j console is the right command I was looking for. It is a web-based graph that acts as an interactive tutorial.
i had the same problem , after the neo4j worked for few weeks it stoop working (without any change that i made)
i have set java_home uninstall and install and now it works
neo4j-enterprise-3.3.4
I was also having weired issue as there was no error but neo4J service did not start.
[xx#ss1 bin]$ ./neo4j console
[xx#ss1 bin]$ .
The problem was with the permission on Java directory and I tried
chmod -R 777 jdk_directory
and problem got solved.
#neo4j #neo4jnotstarting

JBOSS EAP 7.0 with ActiveMQ RAR doesn't work?

I have a war that has being working just fine under EAP 6.4.x (x currently 8, but also under 6 and 4 and so on down to 6.4.0).
The WAR has some simple JMS client features to adding a message to a queue on a remote machine. The target QBroker is ActiveMQ 5.8.0.
I use the 5.8.0 RAR to set up an adapter/connector to the remote broker and then just normal JMS client stuff to push a message into a q. All is fine with this.
Beginning the "port" from 6.4.x to 7.0.1; and I am hung up on the amq 5.8.0 RAR stuff. For starters -- not going to use any of the AMQ Artemis stuff that is part of EAP 7 (yet). Initially I want to get my WAR working under 7.0 with as few changes as possible -- so leaving RAR in place is important.
Under 6.4.x, I use the standalone profile and just deploy the RAR via CLI kinda like this:
./jboss-cli.sh --connect -c "deploy --name=${AMQ_DEPLOY_NAME} --runtime-name=${AMQ_RAR_FNAME} ${_TMPDIR}/${AMQ_RAR_FNAME}"
I then use cli to set up resource adapter, connection def/factory and admin-object for the queue.
Following the same process with EAP 7.0.1, if I use the standalone profile I get
java.lang.NoClassDefFoundError: javax/jms/JMSException
issues while trying to enable the WAR that uses the RAR. Ok so when I used standalone-full I get all sorts of variations of this sort of error:
2016-07-18 15:48:10,867 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "messaging-activemq"),
("server" => "default")
]) - failure description: {
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.messaging-activemq.default is missing [jboss.http-upgrade-registry.default]"],
"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => ["jboss.messaging-activemq.default.jms.manager"],
"Services that may be the cause:" => [
"jboss.http-upgrade-registry.default",
"jboss.naming.context.java.JmsXA"
]
}
}
The above messages suggest something is wrong with the messaging-activemq stuff (or the built in artemis stuff).
In both cases, I do set my EJB default resource adapter to the RAR created above.
So what am I missing on this set up?
Some particulars about my Environment:
War doesn't have any jboss/wildfly specific DDs in it.
I do not have the AMQ RAR deployed as a static module (nor do I want to) -- it is just a jar I have deployed - like other JAR (for DB drivers) or WARS, EJB jars, etc.
cat version.txt
Red Hat JBoss Enterprise Application Platform - Version 7.0.1.GA
java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
uname -a
Linux wellandf3 4.6.4-301.fc24.x86_64 #1 SMP Tue Jul 12 11:50:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Is this NoClassDefFoundError caused by a ClassNotFoundException? If thats the case I would try to add javax.jms.api as global module.

Undefined method `FactoryGirl' -- upgrading from 2.0.2 to 3.4.2

I'm in the process of upgrading from factory_girl (2.0.2 to 3.4.2) and factory_girl_rails (1.1.0 -> 3.4.0)
and I'm having issues with my rspec tests seeing factory girl.
I think I've successfully altered my factories to deal with the new syntax, and have removed the extra require statements that were bringing in multiple copies of the same files. My server now starts up, so I know that the factories.rb file is correctly getting parsed.
Now when I run my rspec tests, I'm getting this error:
NoMethodError: undefined method `FactoryGirl' for #
it 'can be created' do
course = FactoryGirl(:course)
….
end
With Factory Girl 3.4.2, you will need to explicitly use the create method.
course = FactoryGirl.create(:course)