Bhanu
Bhanu

Reputation: 419

MarkLogic : Error while deploying data hub (using gradle) with ssl enabled

I am using MarkLogic version 9.0-3.1 (FREE community edition) and gradle to deploy data hub with command 'gradle mldeploy -i'. Before deployment, I created a 'Certificate Template' in admin console.

Below is my gradle properties file. I intend to enable ssl on ports 8010 (data-hub-STAGING) and 8011 (data-hub-FINAL)


mlAppName=data-hub
mlHost=localhost
mlUsername=xxxxx
mlPassword=xxxxx

mlStagingAuth=basic
mlFinalAuth=basic
mlAppServicesAuthentication=basic

mlTestRestPort=8015
mlTestRestServerName=data-hub-TEST

mlStagingAppserverName=data-hub-STAGING
mlStagingPort=8010
mlStagingDbName=data-hub-STAGING
mlStagingForestsPerHost=4
mlStagingAuth=digest
# To enable SSL for staging
mlStagingSimpleSsl=true

mlFinalAppserverName=data-hub-FINAL
mlFinalPort=8011
mlFinalDbName=data-hub-FINAL
mlFinalForestsPerHost=4
mlFinalAuth=digest
# To enable SSL for final
mlFinalSimpleSsl=true

mlTraceAppserverName=data-hub-TRACING
mlTracePort=8012
mlTraceDbName=data-hub-TRACING
mlTraceForestsPerHost=1
mlTraceAuth=digest

mlJobAppserverName=data-hub-JOBS
mlJobPort=8013
mlJobDbName=data-hub-JOBS
mlJobForestsPerHost=1
mlJobAuth=digest

mlModulesDbName=data-hub-MODULES
mlModulesForestsPerHost=1

mlTriggersDbName=data-hub-TRIGGERS
mlTriggersForestsPerHost=1

mlSchemasDbName=data-hub-SCHEMAS
mlSchemasForestsPerHost=1

# The name of the Role to create for Hub Access
mlHubUserRole=data-hub-role
mlHubUserName=data-hub-user
# this password is autogenerated for you via the 'gradle hubInit' task
mlHubUserPassword=xxxxxxx

Here are the properties for user-config server properties file for data-hub-STAGING server. The properties for data-hub-FINAL are very similar.


{
"server-name": "%%mlStagingAppserverName%%",
"server-type": "http",
"root": "/",
"group-name": "%%GROUP%%",
"port": "%%mlStagingPort%%",
"modules-database": "%%mlModulesDbName%%",
"content-database": "%%mlStagingDbName%%",
"authentication": "%%mlStagingAuth%%",
"default-error-format": "json",
"error-handler": "/MarkLogic/rest-api/error-handler.xqy",
"url-rewriter": "/MarkLogic/rest-api/rewriter.xml",
"rewrite-resolves-globally": true,
"ssl-allow-sslv3" : true,
"ssl-allow-tls" : true,
"ssl-disable-sslv3" : false,
"ssl-disable-tlsv1" : false,
"ssl-disable-tlsv1-1" : false,
"ssl-disable-tlsv1-2" : false,
"ssl-ciphers" : "ALL:!LOW:@STRENGTH",
"ssl-require-client-certificate" : false,
"ssl-hostname" : "localhost",
"ssl-certificate-template" : "https certificate"
}

I confirmed that mlUsername has admin access on the server and that I am passing the correct value though mlPassword, but still getting below error.


23:00:32.864 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: CHALLENGED 23:00:32.864 [DEBUG] [org.apache.http.impl.auth.HttpAuthenticator] Generating response to an authentication challenge us ing digest scheme 23:00:32.864 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED 23:00:32.927 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive for 5000 MILLISECONDS 23:00:32.927 [DEBUG] [org.apache.http.impl.auth.HttpAuthenticator] Authentication succeeded 23:00:32.927 [DEBUG] [org.apache.http.impl.client.TargetAuthenticationStrategy] Caching 'digest' auth scheme for http:// localhost:8002 23:00:32.927 [DEBUG] [org.springframework.web.client.RestTemplate] GET request for "http://localhost:8002/manage/v2/serv ers/Manage/properties?group-id=Default" resulted in 200 (OK) 23:00:32.927 [DEBUG] [org.springframework.web.client.RestTemplate] Reading [java.lang.String] as "application/xml;charse t=UTF-8" using [org.springframework.http.converter.StringHttpMessageConverter@1ec08b7] 23:00:32.927 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection [id: 1][route: {}->http:/ /localhost:8002] can be kept alive for 5.0 seconds 23:00:32.927 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 1][route: {}->http://localhost:8002][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20] 23:00:32.927 [DEBUG] [com.marklogic.client.impl.OkHttpServices] Connecting to localhost at 8000 as admin 23:00:32.927 [DEBUG] [com.marklogic.client.impl.OkHttpServices] Connecting to localhost at 8010 as admin 23:00:32.927 [DEBUG] [com.marklogic.client.impl.OkHttpServices] Posting eval 23:00:32.927 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifac t state for {} from context. 23:00:32.927 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':h ubPreInstallCheck' 23:00:32.927 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :hubPreInstallCheck FAILED 23:00:32.927 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :hubPreInstallCheck (Thread[Daemon worker Thread 2,5,main]) completed. Took 2.544 secs. 23:00:32.927 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry] Worker root.1 completed (0 in use) 23:00:32.943 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 2,5,main]] finished, busy: 2.544 secs, idle: 0.004 secs 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':hubPreInstallC heck'. 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Local message: failed to apply resource at eval: Unauthorized. Server Message: Unauthorized 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try: 23:00:32.943 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the st ack trace. 23:00:32.943 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 23:00:32.943 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED 23:00:32.943 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 23:00:32.943 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] Total time: 5.445 secs 23:00:32.943 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for task histor y cache (G:\Data-Hub\EODH.gradle\3.4\taskHistory)


Upvotes: 1

Views: 919

Answers (1)

Rob S.
Rob S.

Reputation: 3609

Unless you've manually reconfigured the 8000 port to switch the auth to non-default basic, your problem is most likely that you need to set mlAppServicesAuthentication to digest instead of basic.

Also, you declare a lot of basic auth in the top of your gradle properties and then redeclare them as digest later on. I recommend fixing that so it's easier to understand what the properties are actually set to.

Upvotes: 2

Related Questions