Orion not using FIWARE Service on Kubernetes - mongodb

I'm having a weird issue using Orion on Kubernetes. When using Orion 2.5 (also happens with 3.6) and MongoDB 4.4 on Docker-Compose, everything works as expected, I'm able to create and retrieve entities in Orion and they are created properly in databases with the proper name (if fiware-service is service, the database is orion-service).
However, using the same in Kubernetes, with the same commands in Orion and everything configured the same way, it ignores the service. I can see in the logs that Orion receives the service and service-path
time=2022-04-29T12:20:44.125Z | lvl=INFO | corr=cac0239e-c7b6-11ec-abd6-f6ce73396b62 | trans=1651234819-423-00000000003 | from=127.0.0.1 | srv=acc1234121 | subsrv=/asd | comp=Orion | op=logTracing.cpp[148]:logInfoRequestWithPayload | msg=Request received: POST /v2/entities, request payload (288 bytes)
However, it creates the entity in the orion database (without using the -service, which would be orion-acc1234121 in this case).
Could you provide some insights on how to debug the issue and if there is some configuration I'm missing?
Thanks
UPDATE: We finally figured out the issue. In the chart, we were not setting properly the multiservice option, so it was set to false. The point is we are not able to see it neither in the command executed (output of ps command) nor in the environment variables. Anyway, thank you very much for your help, we can mark this as closed and solved.

Related

IBM Cloud Code Engine: How to check logs when app not active?

I have deployed an app to IBM Cloud Code Engine. It has the minimum instances configured to zero, so truly serverless and only active on demand. Now I wanted to check the logs from the CLI with
ibmcloud ce app logs --name myapp --all
it comes back with this message:
FAILED No instances running for application 'myapp'. Verify that
the application name is correct and it is running
How can I check the application logs after it has run?
The Code Engine application (and job) logs can be seen once Application Logging has been enabled. The logs are then available in a separate IBM Cloud Logging dashboard.
I also found this old blog post exlaining how to enable CLI access to those logs. After enabling it I was able to retrieve the app logs using my CLI / development environment.
Depending on what I am after, I am using one of these three lines to get to the log data / lines:
python3 searchLogDNA.py myconfig.json 12 "search term" | jq
for pretty printing, or
python3 searchLogDNA.py myconfig.json 12 "search term" | jq "._line"
to extract the actual log line from the record, or
python3 searchLogDNA.py myconfig.json 12 "search term" | jq "._line | fromjson`"
to turn the string with JSON data in the log line to actual JSON output.

Dgraph: Can't see API data in Console

I'm running a test Dgraph instance in a dgraph/standalone Docker container, using the github.com/dgraph-io/dgo/v200/protos/api API on port 9080 to write data, but can't see the changes in the Console on port 8000. Using the API to query the previously written data works fine, so I wonder if the API and the Console are somehow using different name spaces?
Are you committing the transaction? I have seen users complaining about this, but they forgot to commit the txn.

How to have identity provider configuration page visible in Keycloak?

I'm writing a custom identity provider for Keycloa that I want to deploy using the deployer method (since I want to deploy it in Docker containers). Following an example I found on the web, I've created a maven project where, using the maven-assembly-plugin, I build a jar with dependencies (but I've filtered out the various services implementations my dependencies provide me to just keep the identity provider service).
Things seems to work partly correctly :
Keycloak log indicates my id provider is loading/loaded : keycloak_1 | 09:23:20,056 INFO [org.jboss.as.server] (ServerService Thread Pool -- 29) WFLYSRV0010: Deployed "mycompnay-oidc-id-provider-0.0.1-SNAPSHOT-jar-with-dependencies.jar" (runtime-name :
"mycompany-oidc-id-provider-0.0.1-SNAPSHOT-jar-with-dependencies.jar")
When I go in the Identity Providers panel, the new provider is visible (see screenshot)
But when I try to configure it, everything fails :
The problem is that Keycloak outputs strictly no logs (even when I configure log level to the max).
In my project, I have he following code organization (which gets replicated in jar-with-dependencies)
+---src
+---build
| \---assembly
+---main
| +---java
| | \---com
| | \---mycompany
| | \---mygroup
| | \---security
| | \---oidc
| \---resources
| +---META-INF
| | \---services
| \---themes
| \---base
| \---admin
| \---resources
| \---partials
\---test
+---java
\---resources
What am I missing ?
Maybe you've figured this out by now.
It's not very well documented... I've done something similar a month ago and I faced the same problem. I've figured it out pretty much by poking and guessing, so it might not be the best way to do it but I'll say what I know on this:
You need both the idp and the partial page registered properly.
To be honest I have no idea if you can just extend the base keycloak admin theme in that way. I've tried it but failed horribly. So I've created my own theme extending the base one:
assuming your idp is called foo
src/main/resources/theme/foo/admin/theme.properties
parent=keycloak
import=common/keycloak
src/main/resources/theme/foo/admin/resources/partials/realm-identity-provider-foo.html
<div data-ng-include
data-src="resourceUrl + '/partials/realm-identity-provider-oidc.html'">
</div>
src/main/resources/theme/foo/admin/resources/partials/realm-identity-provider-foo.html
<div data-ng-include
data-src="resourceUrl + '/partials/realm-identity-provider-oidc.html'">
</div>
(I'm using oidc as my idp is extending that one, but you can use whatever makes sense for your case here)
src/main/resources/theme/foo/admin/resources/partials/realm-identity-provider-foo-ext.html
this last file is empty in my case, but as far as I remember you must have it
Then, on the admin console, you need to go and change your admin theme to be foo, and you must refresh your browser so it starts picking up the resources from your new theme. It's important to note that if you are logged in with a user from another realm (e.g. admin from master realm), you have to change the admin theme in master realm, since this is the theme you are actually using now.
If successful you should start seeing in your devtools that template resources now come from your theme, e.g. auth/resources/4.4.0.final/admin/foo/templates/kc-tabs-realm.html
If that's the case then your idp page should be working, or at least you should be able to pick it up from here.
I know it's not the perfect answer, but it might give you a hint on things to consider.
If you make progress or find a better way please share!
I faced the same problem. Resolved by renaming jar file to:
keycloak-{identity provider name}-{version}-SNAPSHOT.jar
Before that the file was called:
keycloak-{identity provider name}-idp-plugin-{version}-SNAPSHOT.jar
…and I was getting "resource not found" error. I suppose keycloak is looking for resources in archives with a name that matches a certain pattern.

How to provision a test user in kamailio?

I have just (for the first time) compiled and installed kamailio, following this guide. For configuration, I am following the documentation here
I am trying to test a new SIP user. I have created it with:
» kamctl add test testpasswd
The user is there:
» kamctl db show subscriber
|----+----------+--------------------+------------+---------------+----------------------------------+----------------------------------+------|
| id | username | domain | password | email_address | ha1 | ha1b | rpid |
|----+----------+--------------------+------------+---------------+----------------------------------+----------------------------------+------|
| 5 | test | tethys.wavilon.net | testpasswd | | 5cf40781f33c6f43a26244046564b67e | eb898de815bc16092e4c2e8c04bfe188 | NULL |
|----+----------+--------------------+------------+---------------+----------------------------------+----------------------------------+------|
I try to connect with my sip client, and the registration times out (Request Timeout (408)). I have tried to verify what is going on by doing:
» kamailio -l <my-ip> -E -ddddd -D 1
And I see lots of messages, one of them interesting:
0(15818) DEBUG: auth [api.c:86]: pre_auth(): auth:pre_auth: Credentials with realm '<my-ip>' not found
But I do not know how to solve this problem. How can I verify what credentials associated to realm <my-ip> are configured? What is a "realm"? I do not find any beginners guide for kamailio. Is there a simple how-to on how to setup a simple kamailio configuration?
The log message you pasted in the question is for debug purposes (hence DEBUG level) and it could be printed for first SIP requests that come with no credentioals (e.g., first REGISTER) -- in such case it is all ok. Those requests are challenged for authentication with 401 replies, then they are resent by phone with credentials in Autorization header.
If for those requests with credentials you don't get the same realm as used in challenge function parameters (e.g., www_challenge(), auth_challenge()...), then the SIP phone might be misconfigured. Typically the realm is the same as SIP domain in order to ensure it is unique, but that is not a must. With default kamailio configuration, the realm is the From header URI domain.
However, you say you get 408 timeout for registration, then the issues might be something else. When the credentials matching the realm are not found, then 401reply is sent back, not 408.
The reason for timeout could be that the REGISTER didn't get to kamailio or kamailio tries to send it somewhere else. You should look at the SIP traffic on the kamailio server to see what happens. You can use ngrep for that purpose, like:
ngrep -d any -qt -W byline . port 5060
Watch to see if the REGISTER comes to kamailio server and if it is attempted to be sent to another IP.
I got the same issue. I that add the alias record in kamailio.cfg and it works well.
alias="tethys.wavilon.net"
Kamailio is a proxy. It is not simple, so if you want something simple, try Asterisk instead. Kamailio configuration requires knowledge of SIP.
For this problem: you set the realm somewhere (in config file or in database) but are not using it for registration. Possible solutions would be to:
Remove the realm or set it to the correct domain name (and use it!). In the default config, that means disabling domains.
Use tethys.wavilon.net as you described in the subscriber table.
For more info, go to the Kamailio site and read this document.

Load balancing MySQL ndbcluster

I have successfully setup ndbcluster version 7.1.26.
This contains 2 data nodes[NDBD], 2 mysql [MYSQLD] nodes and one management [MGMD] node.
Replication works successfully.
My Web application is deployed in JBoss-5.0.1 and using JNDI for connection resources which are specified in application specific ds.xml file in load balanced url forms e.g. jbdc:mysql:loadbalance:host1:port1,host2:port2/databaseName.
host1 : refers to first mysqld node and port1 refers the port it is running on.
host2 : refers to second mysqld node and port2 refers the port it is running on.
When both of the [MySQLD] nodes are up and running everything works fine and cluster responds well, replicates data, and data retrieval operations also work properly.
But issues are raised when any of the [MySQLD] nodes goes down. Data gets inserted/updated/replicated but the application is unable to retrieve data from cluster and web page remains busy working which means busy retrieving data. As soon as the node which was down goes up it responds properly and application goes forward and shows up data retrieved from cluster.
At JBoss 5.0.1 startup it showed up a NullPointerException in class LoadBalancingConnectionProxy.invoke(LoadBalancingConnectionProxy.java:439). Tell me if the above Exception plays any role in the above explained issues.
If anyone had faced issues like above and if has any solution regarding the issues please let me know.
Thanks and regards.
I have resolved the issue as it was a bug in the connectorJ's version.
As The project I am working on was already using both the buggy jar mysql-connector-java-5.0.8.jar and the jar version in which the issue is already resolved i.e. mysql-connector-java-5.1.13-bin.jar.
After all the search when I removed the jar mysql-connector-java-5.0.8.jar my issues got resolved.
All that was problematic was that the ConnectorJ/Driver was getting referred from the buggy jar.
The bug id and url which refers to this issue is:
http://bugs.mysql.com/bug.php?id=31053
.
Thanks for considerations.
Are you using different userids and passwords for each of the hosts(host1, host2) specified in the tag ? (Either directly or using tag) ?