MFPF on IBM Container using Cloudant doesn't work - ibm-cloud

I followed the steps below and choose Cloudant for it's database.
Run IBM MobileFirst Platform Foundation on IBM Containers
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/bluemix/run-foundation-on-bluemix/
It seems that creating db commands executed successfully.
./prepareserverdbs.sh args/prepareserverdbs.properties
Arguments :
-----------
DB_TYPE : cloudantNoSQLDB
DB_SRV_NAME : container1114
DB_SRV_PLAN : Shared
APP_NAME : container1114
RUNTIME_NAME :
SCHEMA_NAME : WLADMIN
Creating database Service - container1114
Successfully created Database Service
Creating application 'container1114'
Application Created Successfully
Getting database configuration
Configuration saved in file '../usr/config/wladmin.xml'
Successfully Completed Cloudant NoSQL DB Service Binding
bash-3.2$ ./prepareserverdbs.sh args/prepareserverdbs.properties
Arguments :
-----------
DB_TYPE : cloudantNoSQLDB
DB_SRV_NAME : container1114
DB_SRV_PLAN : Shared
APP_NAME : container1114
RUNTIME_NAME : AdapterBasedAuth
SCHEMA_NAME : AdapterBasedAuth
Database service 'container1114' exists
Application 'container1114' exists
Getting database configuration
Configuration saved in file '../usr/config/AdapterBasedAuth.xml'
Successfully Completed Cloudant NoSQL DB Service Binding
But when I open the Cloudant web console, I don't see any databases.
I created container using this cloudant service binded app successfully. But when I open MFPF console, I don't see any apps. And I got following error in "messages.log".
How can I fix this?
[11/13/15 12:31:40:955 UTC] 000000b4 com.ibm.worklight.management.ui.servlet.ServiceProxy E Exception Server returned HTTP response code: 500 for URL: http://134.168.23.233:9080/worklightadmin/management-apis/1.0/runtimes?fullInfo=true while redirecting request to http://134.168.23.233:9080/worklightadmin/management-apis/1.0/runtimes?fullInfo=true
[11/13/15 12:34:56:406 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant URL = https://e8ebde9a-5f33-4364-8eb0-d77a028f5f66-bluemix:c27f9feffefc04bf53321c1185757fed47b0d6775334ee802bc0a180xxxxxx#e8ebde9a-5f33-4364-8eb0-d77a02xxxxxxx-bluemix.cloudant.com
[11/13/15 12:34:56:406 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Databasename = mfp_admin_db
[11/13/15 12:34:56:406 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Username = e8ebde9a-5f33-4364-8eb0-d77xxxxx6-bluemix
[11/13/15 12:34:56:406 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Password = ****************************************************************
[11/13/15 12:34:56:406 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Connect Timeout = null
[11/13/15 12:34:56:406 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Socket Timeout = null
[11/13/15 12:34:56:406 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Max Connections = null
[11/13/15 12:34:56:407 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant SSL Authentication = null
[11/13/15 12:34:56:407 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant SSL Configuration = null
[11/13/15 12:34:56:407 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Proxy Host = null
[11/13/15 12:34:56:407 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Proxy Port = null
[11/13/15 12:34:56:408 UTC] 000000ef com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant URL = https://e8ebde9a-5f33-4364-8eb0-d77a028f5f66-bluemix:c27f9feffefc04bf53321c1185757fed47b0d6775334ee802bc0a1800b2746e4#e8ebde9a-5f33-4364-8eb0-d77a0xxxxxx-bluemix.cloudant.com
[11/13/15 12:34:56:408 UTC] 000000ef com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Databasename = mfp_admin_db
[11/13/15 12:34:56:408 UTC] 000000ef com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Username = e8ebde9a-5f33-4364-8eb0-d77a028f5f66-bluemix
[11/13/15 12:34:56:408 UTC] 000000ef com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Password = ****************************************************************
[11/13/15 12:34:56:408 UTC] 000000ef com.ibm.worklight.admin.datastore.DataStoreCloudantUtil I Cloudant Connect Timeout = null
[11/13/15 12:34:56:407 UTC] 000000eb com.ibm.worklight.admin.datastore.DataStoreCloudantUtil E Failed to allocate Cloudant Data Store even though it is configured.

FYI, in case of CloudantDB, the prepareserverdb.scripts doesnt create any tables. It happens during the creation of the container using the startserver scripts.
When you face any problem, you can have a look at the Bluemix status notification page. It will show you every service state live.
https://status.ng.bluemix.net/
Did you add any project runtimes (WAR) before performing the prepareserver.sh script operation. Runtimes (not apps) will be displayed on the MFPF console only after adding the projects before performing the image build (post customization). You can add your apps, adapters after login into the admin console under the Runtime.
For example... MobileFirstStarter image based container has only single runtime by default called "MobileFirstStarter"

Related

How to configure the Visual Studio Code Debugger for Chrome

I'm unable to get the Visual Studio Code Debugger for Chrome running propertly in my environment. I was able to install and set a basic configuration
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "localhost:7777/pls/lj_unittest/LAS_DLG_Startup.GO",
"webRoot": "${workspaceFolder}",
"trace": true,
"sourceMaps": true
}
]
}
for my project that now allows me to launch the Chrome browser from VSCode but I cannot really do anything else and when for example trying to set a break point in my sources the editor shows the Breakpoint set but not yet bound message on the break point and does not stop as expected.
I'm pretty sure that what I'm missing is to somehow link the TypeScript sources that I'm using with the actual resources that will be loaded by the browser but I cannot seem to understand on how to configure this.
My environment is as follows:
The sources are in a src directory in the project root with a src directory that then split into modules, framework and global.
I'm using webpack to build my resources with devtool set to eval-source-map.
The start page (index.html) is generated dynamically on an Apache web server using the url localhost:7777/pls/lj_unittest/LAS_DLG_Startup.GO.
The resources (JS, CSS, HTML, images, etc.) are accessed using the base url localhost:7777/q/p/lj_unittest/.
The vscode-chrome-debug.txt file starts like this:
2019-6-15, 11:15:08.169 UTC
[11:15:08.169 UTC] OS: win32 x64
[11:15:08.169 UTC] Adapter node: v10.2.0 x64
[11:15:08.169 UTC] vscode-chrome-debug-core: 6.7.45
[11:15:08.169 UTC] debugger-for-chrome: 4.11.3
[11:15:08.169 UTC] From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"chrome","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"})
[11:15:08.169 UTC] To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"exceptionBreakpointFilters":[{"label":"All Exceptions","filter":"all","default":false},{"label":"Uncaught Exceptions","filter":"uncaught","default":false}],"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsCompletionsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsRestartFrame":true,"supportsExceptionInfoRequest":true,"supportsDelayedStackTraceLoading":true,"supportsValueFormattingOptions":true,"supportsEvaluateForHovers":true,"supportsLoadedSourcesRequest":true,"supportsRestartRequest":true,"supportsSetExpression":true,"supportsLogPoints":true}}
[11:15:08.169 UTC] To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/initialize","data":{"Versions.DebugAdapterCore":"6.7.45","Versions.DebugAdapter":"4.11.3","successful":"true","timeTakenInMilliseconds":"3.207824","requestType":"request"}}}
[11:15:08.169 UTC] From client: launch({"type":"chrome","request":"launch","name":"Launch Chrome","url":"localhost:7777/pls/lj_unittest/LAS_DLG_Startup.GO?agency=1&usercode=cgable&password=secret&loglevel=7&logtag=dtr&options=test,force,development","webRoot":"D:\\MyDev\\ljs_app\\trunk\\periscope","trace":true,"sourceMaps":true,"__sessionId":"d2726268-a461-4537-8972-aecfffbbb303"})
[11:15:08.169 UTC] To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"debugStarted","data":{"Versions.DebugAdapterCore":"6.7.45","Versions.DebugAdapter":"4.11.3","request":"launch","args":["type","request","name","url","webRoot","trace","sourceMaps","__sessionId","breakOnLoadStrategy","pathMapping","sourceMapPathOverrides","skipFileRegExps","targetFilter","smartStep","showAsyncStacks"]}}}
[11:15:08.169 UTC] Getting browser and debug protocol version via http://127.0.0.1:9222/json/version
[11:15:08.169 UTC] Discovering targets via http://127.0.0.1:9222/json/list
[11:15:08.315 UTC] [chromeSpawnHelper] spawn('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', ["--remote-debugging-port=9222","--no-first-run","--no-default-browser-check","--user-data-dir=C:\\temp\\vscode-chrome-debug-userdatadir_9222","about:blank"])
[11:15:08.326 UTC] got chrome PID: 12120
[11:15:09.206 UTC] Got browser version: Chrome/74.0.3729.169
[11:15:09.206 UTC] Got debug protocol version: 1.3
[11:15:09.211 UTC] To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetDebugProtocolVersion","data":{"Versions.DebugAdapterCore":"6.7.45","Versions.DebugAdapter":"4.11.3"}}}
[11:15:09.217 UTC] To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetCount","data":{"Versions.DebugAdapterCore":"6.7.45","Versions.DebugAdapter":"4.11.3","numTargets":2}}}
[11:15:09.218 UTC] Attaching to target: {"description":"","devtoolsFrontendUrl":"/devtools/inspector.html?ws=localhost/devtools/page/F69F154D5460FC5DFAEFFF707BE33B65","id":"F69F154D5460FC5DFAEFFF707BE33B65","title":"","type":"page","url":"about:blank","webSocketDebuggerUrl":"ws://127.0.0.1:9222/devtools/page/F69F154D5460FC5DFAEFFF707BE33B65","version":{}}
[11:15:09.218 UTC] WebSocket Url: ws://127.0.0.1:9222/devtools/page/F69F154D5460FC5DFAEFFF707BE33B65
[11:15:09.310 UTC] → To target: "{\"id\":1,\"method\":\"Console.enable\"}"
[11:15:09.310 UTC] → To target: "{\"id\":2,\"method\":\"Debugger.enable\"}"
[11:15:09.310 UTC] → To target: "{\"id\":3,\"method\":\"Runtime.enable\"}"
[11:15:09.310 UTC] → To target: "{\"id\":4,\"method\":\"Log.enable\"}"
[11:15:09.310 UTC] → To target: "{\"id\":5,\"method\":\"Runtime.runIfWaitingForDebugger\"}"
[11:15:09.311 UTC] → To target: "{\"id\":6,\"method\":\"Runtime.run\"}"
[11:15:09.311 UTC] → To target: "{\"id\":7,\"method\":\"Page.enable\"}"
[11:15:09.311 UTC] → To target: "{\"id\":8,\"method\":\"Network.enable\",\"params\":{}}"
...
[11:15:12.850 UTC] SourceMaps.getMapForGeneratedPath: Finding SourceMap for d:\MyDev\ljs_app\trunk\periscope\vendor\reset.css by URI: data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi92ZW5kb3IvcmVzZXQuY3NzPzU2NTAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEiLCJmaWxlIjoiLi92ZW5kb3IvcmVzZXQuY3NzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luIl0sInNvdXJjZVJvb3QiOiIifQ== and webRoot/pathMapping: {"/":"d:\\MyDev\\ljs_app\\trunk\\periscope"}
[11:15:12.850 UTC] SourceMaps.getMapForGeneratedPath: Using inlined sourcemap in d:\MyDev\ljs_app\trunk\periscope\vendor\reset.css
[11:15:12.851 UTC] SourceMap: creating for d:\MyDev\ljs_app\trunk\periscope\vendor\reset.css
[11:15:12.851 UTC] SourceMap: sourceRoot:
[11:15:12.851 UTC] SourceMap: sources: ["webpack:///./vendor/reset.css?5650"]
[11:15:12.851 UTC] SourceMap: pathMapping: {"/":"d:\\MyDev\\ljs_app\\trunk\\periscope"}
[11:15:12.851 UTC] SourceMap: no sourceRoot specified, using script dirname: d:\MyDev\ljs_app\trunk\periscope\vendor
[11:15:12.852 UTC] SourceMap: mapping webpack:///./vendor/reset.css?5650 => D:\MyDev\ljs_app\trunk\periscope\vendor\reset.css?5650, via sourceMapPathOverrides entry - "webpack:///./*": "D:\MyDev\ljs_app\trunk\periscope/*"
[11:15:12.854 UTC] SourceMaps.scriptParsed: d:\MyDev\ljs_app\trunk\periscope\vendor\reset.css was just loaded and has mapped sources: ["d:\\MyDev\\ljs_app\\trunk\\periscope\\vendor\\reset.css"]
...
I was able to resolve this problem myself and actually the only problem seems to have been the way how I generated my source maps.
Switching webpack from using eval-source-map to plain old source-map did the job!

Sails cannot connect to remote Redis Server in Dev Environment V1.1.0

I am trying to configure persistent sessions through a remote server with redis.
under sails.config.session I am configuring the following code to connect to my Server
module.exports.session = {
adapter: '#sailshq/connect-redis',
url:"redis://:pass#157.xxx.xxx.xxx:6379/0",
prefix: 'sess:',
secret: "secretSailsSessionDataHere",
cookie: {
maxAge: 1 * 60 * 60 * 1000
},
}
When I lift Sails with:
sails lift --redis or sails lift
The connection defaults to my localhost redis server. If I shutdown my local server it says connection refused from 127.0.0.1 when my server address is xxx.xxx.xxx It also spits out the following error
Redis connection manager failed unexpectedly. Details: Error: Error emitted from Redis client.
Error details:ReplyError: ERR invalid DB index
Any suggestions on how I can configure module.exports.sessions to use the remote server?

SQLSTATE[08006] [7] expected authentication request from server, but received _

I configured my application (laravel 5.3) with travis-ci to work with postgresql database, but I got error in matrix build:
SQLSTATE[08006] [7] expected authentication request from server, but received _
I tried to change pgsql version to 9.4, with no success.
When SSL Mode is set to "prefer", build throws:
SQLSTATE[08006] [7] received invalid response to SSL negotiation: _
On mysql driver works fine and build passes.
Personally, I prefer postgresql rather than mysql, so I asking for help how to resolve this problem.
Thanks.
Had the same error.
In laravel config for Postgresql by default it hase port 3306,
The correct one is 5432.
Or check your system

Java MongoDB Client: authentication failed when access to a server not configured to use an authentication

I have configured Java MongoDB Client to use MongoCredential.
Unfortunately when I access to a server that does not configured to use an authentication I get authentication failed exception:
Caused by: com.mongodb.MongoCommandException: Command failed with error 18: 'Authentication failed.' on server …. The full response is { "ok" : 0.0, "code" : 18, "errmsg" : "Authentication failed." }
I do expect this exception when a server is configured to use an authentication and when Java MongoDB Client but not in this case.
Is it possible to configure Java MongoDB Client not to fail when access to a server not configured to use an authentication?
I am afraid not, your client does not know whether the server has auth enabed or not.
Your client connection code should match the auth parameters from the server, otherwise it fails.
What I did in this case, was to create a connection function which accepts auth credentials, when credentials are passed, used them - create the connection with auth credentials, otherwise no - create the connection with no auth credentials.
In this case, you should know what server has auth enabled

LTPA using IBM Security Access Manager and MobileFirst 6.3 throwing exception

Here is the setup for LTPA token based authentication between ISAM and MobileFirst 6.3:
ISAM appliance is hosting Login page and generating LTPA token using the ltpa.keys from MobileFirst 6.3 server. ISAM also connects to LDAP to authenticate user which eventually forwards a request with generated ltpaToken2 cookie down to MobileFirst 6.3 server. I have configured following authenticationConfig.xml
<securityTests>
...
<customSecurityTest name="ISAMforWorklight-web-securityTest">
<test realm="wl_antiXSRFRealm" />
<test realm="WASLTPARealm" isInternalUserID="true" />
<test realm="HeaderAuthRealm"/>
</customSecurityTest>
</securityTests>
<realms>
...
<realm loginModule="WASLTPAModule" name="WASLTPARealm">
<className>com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator</className>
<parameter name="login-page" value="/login.html"/>
<parameter name="error-page" value="/loginError.html"/>
</realm>
</realms>
<loginModules>
...
<loginModule name="WASLTPAModule">
<className>com.worklight.core.auth.ext.WebSphereLoginModule</className>
</loginModule>
</loginMoudles>
Server.xml contains:
<ltpa keysFileName="<app>/resources/security/ltpa.keys" keysPassword="whatever" expiration="120"/>
It is throwing following exception. Per my understanding default login handler should work seemslessly in MobileFirst when ltpaToke2 is being provided in a request. Not sure what is that I am missing here.
==> trace.log <== [7/22/15 20:28:03:229 UTC] 000000eb id= com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator I
processRequest FWLSE0055I: Not recognized. [project worklight]
[7/22/15 20:28:03:230 UTC] 000000eb id=
com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator 1
processRequest Processing request not recognized [project worklight]
[7/22/15 20:28:03:230 UTC] 000000eb id=
com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator <
processRequest RETURN