codbex / codbex-kronos

SAP HANA XS Classic and ABAP Compatibility Platform
https://codbex.com
Eclipse Public License 2.0
5 stars 3 forks source link

[Migration] Error during migration on Cloud Foundry #109

Open BorisNen opened 2 years ago

BorisNen commented 2 years ago

From xsk created by ThuF: SAP/xsk#843

When I deploy XSK on Cloud Foundry, as described here and trigger the migration process - it hangs and in the Cloud Foundry console I can see the following exception:

Cannot invoke "org.eclipse.dirigible.cms.api.ICmsProvider.getSession()" because "org.eclipse.dirigible.api.v3.cms.CmisFacade.cmsProvider" is null
    at org.eclipse.dirigible.api.v3.cms.CmisFacade.getSession(CmisFacade.java:51)
    at <js> exports.getSession(<eval>:25:846-901)
    at <js> __wrap__(<eval>:13:618-634)
    at <js> Module.loadScript(Unnamed:227:6108-6207)
    at <js> Module.load(Unnamed:205:5450-5474)
    at <js> loadModule(Unnamed:194:5232-5252)
    at <js> require(Unnamed:214:5717-5737)
    at <js> __wrap__(<eval>:14:658-699)
    at <js> Module.loadScript(Unnamed:227:6108-6207)
    at <js> Module.load(Unnamed:205:5450-5474)
    at <js> loadModule(Unnamed:194:5232-5252)
    at <js> require(Unnamed:214:5717-5737)
    at <js> __wrap__(<eval>:13:645-688)
    at <js> Module.loadScript(Unnamed:227:6108-6207)
    at <js> Module.load(Unnamed:205:5450-5474)
    at <js> loadModule(Unnamed:194:5232-5252)
    at <js> require(Unnamed:214:5717-5737)
    at <js> __wrap__(<eval>:12:592-651)
    at <js> Module.loadScript(Unnamed:227:6108-6207)
    at <js> Module.load(Unnamed:205:5450-5474)
    at <js> :program(Unnamed:1:0-31)
    at org.graalvm.polyglot.Context.eval(Context.java:373)
    at org.eclipse.dirigible.engine.js.graalvm.processor.GraalVMJavascriptEngineExecutor.executeService(GraalVMJavascriptEngineExecutor.java:166)
    at org.eclipse.dirigible.engine.js.graalvm.processor.GraalVMJavascriptEngineExecutor.executeServiceModule(GraalVMJavascriptEngineExecutor.java:71)
    at org.eclipse.dirigible.engine.js.processor.DefaultJavascriptEngineExecutor.executeServiceModule(DefaultJavascriptEngineExecutor.java:64)
    at org.eclipse.dirigible.engine.api.script.ScriptEngineExecutorsManager.executeServiceModule(ScriptEngineExecutorsManager.java:43)
    at org.eclipse.dirigible.core.scheduler.handler.JobHandler.execute(JobHandler.java:34)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

Also I can see the following http trace log, which seems to be more closely related to the migration process:

[APP/PROC/WEB/0] OUT org.eclipse.dirigible.api.v3.log.JSServiceException: null has no such function "toString"
[TRACE] [http-nio-8080-exec-3] app.http.rs.controller - Before serving request for Resource[get-process], Method[POST], Content-Type[["application/json"]], Accept[["application/json","text/plain","*/*"]]
[RTR/10] OUT xsk-haas-migration-service-test.cfapps.sap.hana.ondemand.com - [2021-11-26T07:52:13.808458777Z] "POST /services/v4/js/ide-migration/server/migration/api/migration-rest-api.js/get-process HTTP/1.1" 500 151 1368 "https://xsk-haas-migration-service-test.cfapps.sap.hana.ondemand.com/services/v4/web/ide-migration/migration-launch.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36 Edg/96.0.1054.29" "-" "10.0.201.101:61315" x_forwarded_for:"-" x_forwarded_proto:"https" vcap_request_id:"fc8fd45a-f6fe-4ce4-756f-ed8710a6a598" response_time:0.488986 gorouter_time:0.069089 app_id:"61294738-fe45-4631-abff-76aa6ee07824" app_index:"0" instance_id:"74b5569a-44b8-4f67-67cd-e130" x_cf_routererror:"-" x_correlationid:"-" tenantid:"-" sap_passport:"-" x_scp_request_id:"61d4948c-7347-4614-803f-96e3dc028c10-61A0922C-E3D0C1" x_cf_app_instance:"-" x_forwarded_host:"-" x_custom_host:"-" x_ssl_client:"-" x_ssl_client_session_id:"-" x_ssl_client_verify:"-" x_ssl_client_subject_dn:"-" x_ssl_client_subject_cn:"-" x_ssl_client_issuer_dn:"-" x_ssl_client_notbefore:"-" x_ssl_client_notafter:"-" x_b3_traceid:"0c3a4e1827aff067" x_b3_spanid:"0c3a4e1827aff067" x_b3_parentspanid:"-" b3:"0c3a4e1827aff067-0c3a4e1827aff067"
[TRACE] [http-nio-8080-exec-5] app.http.rs.controller - Before serving request for Resource[get-process], Method[POST], Content-Type[["application/json"]], Accept[["application/json","text/plain","*/*"]]
[TRACE] [http-nio-8080-exec-5] app.http.rs.controller - Serving request for Resource[get-process], Method[POST], Content-Type[["application/json"]], Accept[["application/json","text/plain","*/*"]]
[ERROR] [http-nio-8080-exec-5] app.http.rs.controller - Serving resource[get-process], Verb[POST], Content-Type[application/json], Accept[application/json,text/plain,*/*] finished in error
BorisNen commented 2 years ago

@ThuF We will check if we can find out if the user account is locked or a 2FA code is required but I think in those cases, the Neo SDK and the OAuth service just return a message saying wrong credentials are used. This is expected as it would probably be a security concern if the OAuth service or the Neo SDK give such information.

BorisNen commented 2 years ago

@vmutafov wrong wording from my side :) What I mean is to update the error message when "Wrong Credentials" occurs to include additional text, that points to these three possible reasons for Wrong Credentials error. Otherwise if the user credentials input was correct, it gets very hard to understand whether 2FA is needed or the account was locked.

BorisNen commented 2 years ago

Ah, ok, we can do that. Thanks for the clarification ;)

BorisNen commented 2 years ago

Proposal

Update the error messages in the Migration Perspective (and handling of OAuth Service response), so it's clear that either of these cases occurred:

  1. Wrong Credentials
  2. Locked Account
  3. Missing 2FA Code