WFLYCTL0083: failed to load module org,keycloak.keycloak-server-subsytem - jboss

When I am starting my Wildfly server I am getting this error which ultimately shuts my server from running. What am I missing while installing the server ?

Adding little more information to what Haseb Ansari has provided already. Basically, here are the steps that needs to be performed to get keycloak setup in wildfly.
Assumption:
Wildfly is extracted to ${user.home}/apps/wildfly, lets call it ${jboss.home} here.
Following are the steps that needs to be done.
1. Download OpenID connect adapter from keycloak
2. Extract keycloak-wildfly-adapter-dist-3.3.0.CR2.zip
$> cd ~/Downloads
$>unzip ./keycloak-wildfly-adapter-dist-3.3.0.CR2.zip -d keycloak-wildfly-adapter
3. copy files to ${jboss.home}
cd keycloak-wildfly-adapter/bin
cp ./adapter-* ${jboss.home}
cp -rf ./modules ${jboss.home}
4. Execute jboss cli
cd ${jboss.home}
$>./bin/jboss-cli.sh --file=adapter-elytron-install-offline.cli
You get a message as below [copied from terminal]
$> wildfly]$./bin/jboss-cli.sh --file=adapter-elytron-install-offline.cli
{
"outcome" => "success",
"result" => [("keycloak" => "1.1.0")]
}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
You may use ../bin/jboss-cli.sh --file=adapter-install-offline.cli if your wildfly version is 10.
5. Run jboss
./bin/standalone.sh

The same error occurred with me.
The solution was copying the keycloak module to the folder below:
{your_jboss_folder}/modules/system/add-ons/keycloak/
I had it running on another server, so it was simply copy and paste. If you don't have it, try searching these modules on keycloak website.
Hope it helps.

I solved this issue by copying the Keycloak adapter content to ${WILDFLY_HOME} and the executing this command from command line
./jboss-cli.sh --file=adapter-install-offline.cli
And then I start the server and everything works fine

Assumptions:
Keycloak adapter directory: ${keycloak}
WildFly directory : ${wildfly}
Copy all the contents from ${keycloak}/modules/system/ to ${wildfly}/modules/system/
Then navigate to ${wildfly}/bin and copy the contents of the folder ${keycloak}/bin
Now run the command : ./jboss-cli.sh --file=adapter-elytron-install-offline.cli
It should work.
The main thing here is to copy from modules directory of keycloak adapter to wildfly's modules directory.

Related

Is it possible to configure Azure Windows VMs using Ansible on Azure DevOps Microsoft Hosted Ubuntu agents?

We try to configure an Azure VM using an Azure DevOps pipeline. We first create the machine using Terraform and then we need to configure it. Right now the pipeline is functional when we use a customized Ubuntu Azure DevOps agent (a VM we setup ourselves in Azure).
We prefer to use a Microsoft Hosted Ubuntu Agent. When we try to run our pipeline using the Microsoft Hosted Ubuntu agent we fail with a message "winrm or requests is not installed".
We have done a lot of research and attempts to install the needed components, but none have been fruitful.
All the examples and documentation on the internet we can find don't mention our specific use case. Ansible configuration of Windows VMs in Azure from a Microsoft Hosted Ubuntu agent. Isn't it possible for some reason?
If it is, any pointers in the right direction will be much appreciated!
The error we see in the Azure DevOps pipeline is this:
ansible-playbook -vvvv -i inventory/hosts.cfg main.yml --extra-vars '{"customer_name": "<REMOVED>" }'
ansible-playbook [core 2.12.5]
config file = None
configured module search path = ['/home/vsts/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/vsts/.local/lib/python3.8/site-packages/ansible
ansible collection location = /home/vsts/.ansible/collections:/usr/share/ansible/collections
executable location = /home/vsts/.local/bin/ansible-playbook
python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
jinja version = 2.10.1
libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /home/vsts/work/1/s/ansible/inventory/hosts.cfg as it did not pass its verify_file() method
auto declined parsing /home/vsts/work/1/s/ansible/inventory/hosts.cfg as it did not pass its verify_file() method
yaml declined parsing /home/vsts/work/1/s/ansible/inventory/hosts.cfg as it did not pass its verify_file() method
Parsed /home/vsts/work/1/s/ansible/inventory/hosts.cfg inventory source with ini plugin
Loading collection ansible.windows from /home/vsts/.local/lib/python3.8/site-packages/ansible_collections/ansible/windows
Loading collection community.windows from /home/vsts/.local/lib/python3.8/site-packages/ansible_collections/community/windows
redirecting (type: modules) ansible.builtin.win_service to ansible.windows.win_service
redirecting (type: modules) ansible.builtin.win_service to ansible.windows.win_service
redirecting (type: modules) ansible.builtin.win_service to ansible.windows.win_service
redirecting (type: modules) ansible.builtin.win_service to ansible.windows.win_service
redirecting (type: modules) ansible.builtin.win_service to ansible.windows.win_service
Loading callback plugin default of type stdout, v2.0 from /home/vsts/.local/lib/python3.8/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
PLAYBOOK: main.yml *************************************************************
Positional arguments: main.yml
verbosity: 4
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/home/vsts/work/1/s/ansible/inventory/hosts.cfg',)
extra_vars: ('{"customer_name": "<REMOVED>"}',)
forks: 5
1 plays in main.yml
PLAY [windows:pro] *********************************************************
TASK [Gathering Facts] *********************************************************
task path: /home/vsts/work/1/s/ansible/main.yml:1
redirecting (type: modules) ansible.builtin.setup to ansible.windows.setup
Using module file /home/vsts/.local/lib/python3.8/site-packages/ansible_collections/ansible/windows/plugins/modules/setup.ps1
Pipelining is enabled.
**fatal: [51.144.125.149]: FAILED! => {
"msg": "winrm or requests is not installed: No module named 'winrm'"
}**
PLAY RECAP *********************************************************************
51.144.125.149 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
We tried to fix the problem by installing various potentially relevant components in the pipeline just before running the ansible-playbook command, for instance this one
pip3 install pywinrm
Later, based on input on this SO question we tried this in the pipeline:
python3 -m pip install --ignore-installed pywinrm
find / -name winrm.py
ansible-playbook -vvv -i inventory/hosts.cfg main.yml
The find command finds winrm.py here:
/opt/pipx/venvs/ansible-core/lib/python3.8/site-packages/ansible/plugins/connection/winrm.py
The ansible-playbook configuration we are using is:
ansible-playbook [core 2.12.5]
config file = None
configured module search path =
['/home/vsts/.ansible/plugins/modules',
'/usr/share/ansible/plugins/modules']
ansible python module location = /opt/pipx/venvs/ansible-
core/lib/python3.8/site-packages/ansible
ansible collection location =
/home/vsts/.ansible/collections:/usr/share/ansible/collections
executable location = /opt/pipx_bin/ansible-playbook
python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC
9.4.0]
jinja version = 3.1.2
libyaml = True
No config file found; using defaults
The error we get is:
task path: /home/vsts/work/1/s/ansible/main.yml:1
redirecting (type: modules) ansible.builtin.setup to
ansible.windows.setup
Using module file /opt/pipx/venvs/ansible-
core/lib/python3.8/site-
packages/ansible_collections/ansible/windows/plugins/modules/
setup.ps1
Pipelining is enabled.
fatal: [13.73.148.141]: FAILED! => {
"msg": "winrm or requests is not installed: No module named
'winrm'"
}
you can try solution in RedHat knowledgebase
https://access.redhat.com/solutions/3356681
Last comment suggestion (replace yum with apt commands)
I was getting this error even if python2-winrm version 0.3.0 is
already installed via yum
yum list installed | grep winrm python2-winrm.noarch
0.3.0-1.el7 #epel
pip install "pywinrm>=0.2.2" only resulted in "Requirement already
satisfied"
I ran this to resolve the error -
yum autoremove python2-winrm.noarch
pip install "pywinrm>=0.2.2"
Then ping: pong worked just fine over https, port=5986
ram#thinkred1cartoon$ ansible all -i hosts.txt -m win_ping
172.16.96.135 | SUCCESS => {
"changed": false,
"ping": "pong" }
conversely, if you don't want to run command 1, then command 2 won't
work for you. In that case, run command 3
3 ) pip install --ignore-installed "pywinrm>=0.2.2"

Running stanford moss because of institution proxy

I am running moss by Stanford.
I am using Perl script sent by Stanford at the time of registration.
but it is giving error as :
Checking files . . .
OK
Could not connect to server moss.stanford.edu: Connection refused
I tried adding institute proxy also in the code as follows :
$sock = new IO::Socket::INET (
ProxyAddr => '10.3.100.207',
ProxyPort => '8080',
PeerAddr => $server,
PeerPort => $port,
Proto => 'tcp',
);
But it is giving the same error as above.
One possible solution is to set up a virtual environment and run the script.
But what can be another solution ?
Here is what I did and it worked.
I used Google colab for it.
I uploaded the files to be checked for plagiarism and the perl script to colab and then ran the perl script in the notebook
!perl moss.pl -l python -m 53 -c "Files" ./*.py

Configure Hypnotoad to use a different user/group

I want to my Mojolicious::Lite that is started under root using hypnotoad to run under a different user/group (foobar/foobar in the below example).
I'm using the following configuration call:
app->config(
hypnotoad => {
listen => ["http://*:$API_Port"],
user => 'foobar',
group => 'foobar',
proxy => 1,
}
);
Unfortunately, it appears that all children still run under root, and any files created in routes also use the root and 0644 instead of the foobar and 0664.
The docs for hypnotoad appear to be rather sparse, as the only reference I could find to changing the user/group thus far are in a github issue: https://github.com/kraih/mojo/issues/733
The cpan module, Mojolicious::Plugin::SetUserGroup, appears to solve this:
# Mojolicious::Lite
plugin SetUserGroup => { user => $user, group => $group };
I got the simple solution! Just edit your Systemd Unit file and add two options: User and Group...
Example:
[Unit]
Description=My Perl service
Requires=network.target
After=network.target
# put here other service requirements
[Service]
User=testuser1
Group=testuser1
Type=simple
Restart=always
SyslogIdentifier=testperlservice
PIDFile=/home/testuser1/tmp/testperlservice.pid
ExecStart=/usr/local/bin/hypnotoad /home/testuser1/script/test -f
ExecStop=/usr/local/bin/hypnotoad -s /home/testuser1/script/test
ExecReload=/usr/local/bin/hypnotoad /home/testuser1/script/test

Not able to use 'copy_perm' option in Net::SFTP::Foreign module

I want to copy the file from remote host to the local host with the preservation of file permission, hence i tried to use the 'copy_perm' option as per the documentation of Net::SFTP::Foreign as mentioned below -
my $sftp = Net::SFTP::Foreign->new(
host => $host,
key_path => $ssh_key_path,
copy_perm => 1,
more => [ -o => 'Compression yes' ]
);
But I am getting the below error -
Invalid option 'copy_perm' or bad combination of options at test.pl at line 101.
The line 101 is the Net::SFTP::Foreign object creation as mentioned above.
Did i miss anything or anyone has faced same issue before?
That's because copy_perm isn't an option for the new method. You use it in get and put.

Can't get DBD::ODBC to work with DataDirect ODBC Driver Manager 7.0 - [DataDirect][ODBC lib] Specified driver could not be loaded (SQL-IM003)

I'm trying to set-up PERL DBD::ODBC to use the DataDirect ODBC Driver Manager (7.0) that is provided with Informatica PowerCenter. This is on a Solaris 10 Sparc64 environment. We've had this working in the past with the 5.1 driver manager (on an sp32 server), but now running into problems since moving to this new version. For all ODBC connections I get this error:
failed: [DataDirect][ODBC lib] Specified driver could not be loaded (SQL-IM003) at test_odbctd.pl line 19
Can't connect to DBI:ODBC:tdedwprd: [DataDirect][ODBC lib] Specified driver could not be loaded (SQL-IM003) at test_odbctd.pl line 19, <STDIN> line 2.
I have tested the same connections using the "ssgodbc" tool provided by Informatica for testing and they work. I can login and run queries.
As an example, here's one of my Teradata connections as definied in odbc.ini (we're having the same problem with DB2, SQL Server, Teradata, Sybase, PowerExchange, etc). Don't ask why I have to hard-code the full driver path in this file instead of odbcinst.ini. I couldn't get it to work and the Informatica standard is to hard-code it in odbc.ini so I don't want to affect our support from them.
[tddev]
Driver=/opt/teradata/client/odbc/drivers/tdata.so
Description=Teradata Development
DBCName=teradata1
DBCName2=teradata2
MaxRespSize=65477
DateTimeFormat=AAA
EnableExtendedStmtInfo=No
LoginTimeout=60
ldd output for the driver:
$ ldd /opt/teradata/client/odbc/drivers/tdata.so
warning: ldd: /opt/teradata/client/odbc/drivers/tdata.so: is not executable
libCstd.so.1 => /opt/SUNWspro/lib/v9/libCstd.so.1
libthread.so.1 => /usr/lib/sparcv9/libthread.so.1
libm.so.1 => /usr/lib/sparcv9/libm.so.1
libw.so.1 => /usr/lib/sparcv9/libw.so.1
libc.so.1 => /usr/lib/sparcv9/libc.so.1
libsocket.so.1 => /usr/lib/sparcv9/libsocket.so.1
libnsl.so.1 => /usr/lib/sparcv9/libnsl.so.1
libxnet.so.1 => /usr/lib/sparcv9/libxnet.so.1
libodbcinst.so => /opt/powercenter/v951/ODBC7.0/lib/libodbcinst.so
libddicu25.so => /opt/teradata/client/odbc/lib/libddicu25.so
libtdparse.so => /opt/teradata/client/odbc/lib/libtdparse.so
libicudatatd.so.46 => /usr/lib/sparcv9/libicudatatd.so.46
libicuuctd.so.46 => /usr/lib/sparcv9/libicuuctd.so.46
libCrun.so.1 => /opt/SUNWspro/prod/usr/lib/v9/libCrun.so.1
libmp.so.2 => /lib/64/libmp.so.2
libmd.so.1 => /lib/64/libmd.so.1
libscf.so.1 => /lib/64/libscf.so.1
libDWicu26.so => /opt/powercenter/v951/ODBC7.0/lib/libDWicu26.so
libdl.so.1 => /usr/lib/sparcv9/libdl.so.1
librt.so.1 => /usr/lib/sparcv9/librt.so.1
libpthread.so.1 => /usr/lib/sparcv9/libpthread.so.1
libdoor.so.1 => /lib/64/libdoor.so.1
libuutil.so.1 => /lib/64/libuutil.so.1
libgen.so.1 => /lib/64/libgen.so.1
libaio.so.1 => /lib/64/libaio.so.1
libm.so.2 => /lib/64/libm.so.2
/lib/sparcv9/../libm/sparcv9/libm_hwcap1.so.2
/platform/sun4v/lib/sparcv9/libc_psr.so.1
/platform/sun4v/lib/sparcv9/libmd_psr.so.1
I tried to run strace as the user that uses these connections, but I get this error so not sure what to do with that:
$ strace perl test_odbctd.pl
ERROR: unable to open /dev/log
Here's the PERL test script we're using:
#!/usr/bin/perl -w
use DBI;
# use DBD::ODBC;
# use DBD::DB2::Constants;
my $data_source = "DBI:ODBC:tdedwprd";
#Prompt for username
print "Enter user:";
my $user = <STDIN>;
#Prompt for password
print "Enter password:";
my $password =<STDIN>;
# Connect to the tdedwdev teradata database
my $dbh = DBI->connect($data_source, $user, $password, {AutoCommit =>1})
or die "Can't connect to $data_source: $DBI::errstr";
$stmt = "SELECT database, time; ";
$sth = $dbh->prepare($stmt);
$sth->execute();
#associate variable with output columns...
$sth->bind_col(1,\$db);
$sth->bind_col(2,\$timestap);
while ($sth->fetch) {
print "The database is: $db\n";
print "The time is: $timestap\n";
}
$dbh->disconnect;
The above script works on our existing dev box (Solaris 10 sp32), but not on the new one we're building (Solaris 10 sp64).
The old server had the driver manager bundled with Informatica PowerCenter 8.6.1 sp32, and the new one has Informatica PowerCenter 9.5.1 sp64.
The DBD::ODBC module did compile fine with some modifications, roughly following this guide from DataDirect (the logic was basically the same, but the references to the Makefile.PL weren't identical):
http://knowledgebase.datadirect.com/articles/Article/2973
I enabled Trace in odbc.ini (Trace=1) but this just resulted in a "Segmentation Fault (core dumped)". However it does output a trace file when using the Informatica-provided "ssgodbc" tool.
I tried using isql, but it seems to be tied to the Sybase drivers so I'm not sure if I can use that. I couldn't get it to work
$ which isql
/opt/sybase/OCS-15_0/bin/isql
Here are my ODBC environment variables:
$ env | grep -i odbc
MANPATH=/usr/share/man:/opt/teradata/client/14.00/odbc_32/help/man:
ODBCINST=/opt/powercenter/v951/ODBC7.0/odbcinst.ini
LD_LIBRARY_PATH=/opt/powercenter/v951/ODBC7.0/lib:/opt/powercenter/v951/server/bin:/home/etlin1d/sqllib/lib:/opt/pwx/v851:/opt/sybase/OCS-15_0/lib:/opt/sybase/OCS-15_0/lib3p64:/opt/sybase/OCS-15_0/lib3p:/opt/teradata/client/14.00/tbuild/lib:/opt/teradata/client/odbc/lib:/opt/teradata/client/odbc/drivers:/opt/teradata/client/14.00/tbuild/lib:/usr/lib:/prj/db2/etlin1d/sqllib/lib64:/prj/db2/etlin1d/sqllib/lib32:/usr/lib
LD_LIBRARY_PATH_64=/opt/powercenter/v951/ODBC7.0/lib:/opt/powercenter/v951/server/bin:/opt/pwx/v851:/prj/db2/etlin1d/sqllib/lib64:/opt/sybase/OCS-15_0/lib:/opt/sybase/OCS-15_0/lib3p64:/opt/sybase/OCS-15_0/lib3p:/opt/teradata/client/14.00/tbuild/lib:/opt/teradata/client/odbc/lib:/opt/teradata/client/odbc/drivers:/usr/lib
NLSPATH=/opt/teradata/client/14.00/odbc_64/msg:/opt/teradata/client/14.00/odbc_32/msg:/opt/teradata/client/14.00/tbuild/msg/%N:/opt/teradata/client/14.00/tbuild/msg/%N:/opt/teradata/client/14.00/odbc_32/msg/%N:
PATH=/opt/sybase/ASEP/bin:/opt/sybase/DBISQL/bin:/opt/sybase/UAF-2_0/bin:/opt/sybase/OCS-15_0/bin:/opt/teradata/client/14.00/tbuild/bin:/opt/teradata/client/14.00/tbuild/bin:/usr/bin:/bin:/usr/local/bin:/opt/powercenter/v951/ODBC7.0/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/powercenter/v951/server/bin:.:/prj/db2/etlin1d/sqllib/bin:/prj/db2/etlin1d/sqllib/adm:/prj/db2/etlin1d/sqllib/misc:/prj/db2/etlin1d/sqllib/db2tss/bin
ODBCINI=/opt/powercenter/v951/ODBC7.0/odbc.ini
ODBCHOME=/opt/powercenter/v951/ODBC7.0
I'm totally at a loss. I'm not a Solaris admin by trade though (in fact this is my first significant exposure to Solaris and Informatica really) so I'm hoping I'm missing something obvious.
I'm not sure what else to share right now. Any help would be GREATLY appreciated. I've been stuck on problems with this ODBC implementation for weeks.
I realised that the problem here was not with the driver manager. It was caused by the fact that I was using 32-bit Perl but a 64-bit ODBC driver. If I added an entry that used a 32-bit ODBC driver to odbc.ini (despite the driver manager being 64-bit) then there is no problem (although it did raise a licensing issue which is separate to this discussion).
In short, this error message occured because the driver is not the same bitness as the client (check by running the file command against both client and driver):
Specified driver could not be loaded
An example of the file command is:
file /opt/teradata/client/odbc/drivers/tdata.so
However, it also occurs when the driver cannot find all of its dependent drivers, which can be checked using ldd on the driver to make sure it is finding all of its dependencies.
An example of the ldd command is:
ldd /opt/teradata/client/odbc/drivers/tdata.so
I tried the above method given by LokMac, all dependant drivers were there and still it wont work, at the end I added "# Driver: The location where the ODBC driver is installed to." before driver path and it magically worked:
[tddemo]
# Driver: The location where the ODBC driver is installed to.
Driver=/opt/teradata/client/16.20/odbc_64/lib/tdataodbc_sb64.so
in above, tddemo is my DNS name and since I am on TD Express 16.20, thats why my driver name is different.