I am trying to configure an Alfresco repository connection using basic authentication in Alfresco Process Services. However, I get the following error appear when I attempt to authorise an account with the connection.
Could not save account details: UNEXPECTED com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (org.apache.http.conn.EofSensorInputStream); line: 1, column: 2]
I am running APS and Content Services using their docker images configured within docker-compose files, and the APS container logs show more detail about the error. It seems the API response is returning HTML instead of the expected JSON
2023-10-29 12:14:25 12:14:25 [http-nio-8080-exec-2] ERROR com.activiti.alfrescoconnector.service.AlfrescoServicesImpl - error while reading response
2023-10-29 12:14:25 com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
2023-10-29 12:14:25 at [Source: (org.apache.http.conn.EofSensorInputStream); line: 1, column: 2]
2023-10-29 12:14:25 at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2391)
2023-10-29 12:14:25 at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:735)
2023-10-29 12:14:25 at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:659)
2023-10-29 12:14:25 at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2737)
APS docker-compose.yml file
version: '3'
services:
aps:
image: alfresco/process-services:2.3.1
environment:
ACTIVITI_DATASOURCE_DRIVER: org.postgresql.Driver
ACTIVITI_HIBERNATE_DIALECT: org.hibernate.dialect.PostgreSQLDialect
ACTIVITI_LICENSE_MULTI_TENANT: false
ACTIVITI_DATASOURCE_URL: jdbc:postgresql://localhost:5432/activiti
ACTIVITI_DATASOURCE_USERNAME: alfresco
ACTIVITI_DATASOURCE_PASSWORD: alfresco
ACTIVITI_CORS_ENABLED: true
ACTIVITI_CSRF_DISABLED: true
ports:
- 8081:8080
volumes:
- ./activiti.lic:/usr/local/tomcat/lib/activiti.lic:ro
- ./activiti-app.properties:/usr/local/tomcat/lib/activiti-app.properties
postgres:
image: postgres:13.1
environment:
POSTGRES_USER: alfresco
POSTGRES_PASSWORD: alfresco
POSTGRES_DB: activiti
ports:
- 5433:5432
volumes:
- ./db-data/:/var/lib/postgresql/data/
ACS docker-compose.yml (NOTE: this is a snippet of the file)
version: "2"
services:
alfresco:
image: quay.io/alfresco/alfresco-content-repository:7.4.1.1
mem_limit: 1900m
environment:
JAVA_TOOL_OPTIONS: >-
-Dencryption.keystore.type=JCEKS
-Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
-Dencryption.keyAlgorithm=DESede
-Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore
-Dmetadata-keystore.password=mp6yc0UD9e
-Dmetadata-keystore.aliases=metadata
-Dmetadata-keystore.metadata.password=oKIWzVdEdA
-Dmetadata-keystore.metadata.algorithm=DESede
JAVA_OPTS: >-
-Ddb.driver=org.postgresql.Driver
-Ddb.username=alfresco
-Ddb.password=alfresco
-Ddb.url=jdbc:postgresql://postgres:5432/alfresco
-Dsolr.host=solr6
-Dsolr.port=8983
-Dsolr.secureComms=secret
-Dsolr.sharedSecret=secret
-Dsolr.base.url=/solr
-Dindex.subsystem.name=solr6
-Dshare.host=127.0.0.1
-Dshare.port=8080
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
-Dmessaging.broker.url="failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true"
-Ddeployment.method=DOCKER_COMPOSE
-Dtransform.service.enabled=true
-Dtransform.service.url=http://transform-router:8095
-Dsfs.url=http://shared-file-store:8099/
-DlocalTransform.core-aio.url=http://transform-core-aio:8090/
-Dcsrf.filter.enabled=false
-Ddsync.service.uris=http://localhost:9090/alfresco
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
volumes:
- ./license:/usr/local/tomcat/shared/classes/alfresco/extension/license
transform-router:
mem_limit: 512m
image: quay.io/alfresco/alfresco-transform-router:3.0.0
environment:
JAVA_OPTS: >-
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
ACTIVEMQ_URL: nio://activemq:61616
CORE_AIO_URL: http://transform-core-aio:8090
FILE_STORE_URL: >-
http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file
ports:
- "8095:8095"
links:
- activemq
share:
image: quay.io/alfresco/alfresco-share:7.4.1.1
mem_limit: 1g
environment:
REPO_HOST: "alfresco"
REPO_PORT: "8080"
JAVA_OPTS: >-
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Dalfresco.context=alfresco
-Dalfresco.protocol=http
postgres:
image: postgres:14.4
mem_limit: 512m
environment:
- POSTGRES_PASSWORD=alfresco
- POSTGRES_USER=alfresco
- POSTGRES_DB=alfresco
command: postgres -c max_connections=300 -c log_min_messages=LOG
ports:
- "5432:5432"
I have as many things as I could think of including:
- Followed the APS documentation to connect to content services exactly.
- Testing different APS and ACS image versions.
- Different environment variable configurations and settings within the docker-compose image.
- Different postgres database versions.
- Tested different configurations within the activiti-app.properties file.
- Tested the relevant ACS api endpoints on Postman
I have spent hours upon hours testing different things, but the same error appears every time. So I have resorted to posting my first Stack Overflow post to see if anyone could help or provide me with some guidance :)
Note: I had to remove some content because Stack Overflow thinks its Spam.