2

TLDR;

The following command fails to run in Virtual Box guest OS to build and install an artifact onto an AEM 6.3 Author instance running on the host OS.

mvn -PautoInstallPackage clean install

The host machine is behind a corporate proxy and guest OS has CNTLM and Maven proxy file configured.

Longer version

I use a VirtualBox VM for development - mainly to mitigate corporate software installation restrictions. Trying to run the following command to build and deploy an AEM 6.3 multi module project, but it keeps failing. The following is the maven command:

mvn -PautoInstallPackage clean install

And the build stop running beyond this point:

[INFO] Discarding unexpected response: HTTP/1.1 100 Continue

When I run the same command with the debug flag (-X), I get the following lines before the error:

...
[DEBUG] Request body sent
[DEBUG] << "HTTP/1.1 100 Continue[\r][\n]"
[DEBUG] << "HTTP/1.1 100 Continue[\r][\n]"
[DEBUG] << "Proxy-Connection: keep-alive[\r][\n]"
[DEBUG] << "Connection: keep-alive[\r][\n]"
[DEBUG] << "[\r][\n]"
[INFO] Discarding unexpected response: HTTP/1.1 100 Continue

Some key details of my setup:

  • Host OS is Windows 7 Enterprise - this is where my AEM 6.3 Author instance is running
  • Guest OS is Ubuntu 16.04.4 LTS - this is where I do development
  • The computer is connected to a network that sits behind a corporate proxy
  • Proxy is setup on VM guest with CNTLM, http_proxy, https_proxy env variables and ~/.m2/settings.xml for Maven
  • Maven can fetch all dependencies from Internet without any issue
  • All other commands like npm install, curl work fine fetching content from Internet
  • I have added 10.* to the white-list in both CNTLM and Maven settings.xml file
  • In Virtual Box settings I have added the Host-only Adapter
  • I can connect to the AEM instance running on host OS through browser via http://10.0.2.2:4502

Full error log file: https://paste.ee/p/dph1n

Any help is highly appreciated.

Nadee
  • 97
  • 2
  • 9

2 Answers2

3

Deploying to AEM on the host from within a VM does not require a proxy at all.

Try setting <useProxy>false</useProxy> in the configuration section of the Content Package maven plugin. See content-package-maven-plugin docs for more detail.

Cody Hamilton
  • 331
  • 1
  • 4
1

What I see in logs:

  • plugin content-package-maven-plugin tries to send compiled project to http://10.0.2.2:4502/crx/packmgr/service.jsp`
  • plugin uses Jakarta Commons-HttpClient/3.1 for HTTP
  • plugin set property http.protocol.expect-continue = true in HttpClient which means it could handle HTTP response 100-Continue in a proper way
  • After sending headers of HTTP request plugin/HttpClient wait for 100-Continue during timeout 5 seconds (Set parameter http.connection.timeout = 5000 in log https://paste.ee/p/dph1n#s=0&l=2481)
  • No response from servere during 5 seconds (probably, no timestamps in logs). Message in log [INFO] 100 (continue) read timeout. Resume sending the request https://paste.ee/p/dph1n#s=0&l=2500
  • plugin/HttpClient send HTTP request body
  • server return unexpected response with 100-continue. Unexpected because client already not waiting for it.

Try to increase timeout in content-package-maven-plugin configuration (https://paste.ee/p/dph1n#s=0&l=2448). Probably 5 seconds is not enouph to get response from server.

UPDATED I'm not sure if you are using squid as proxy (port 3128 in your logs). But if it's true you can try use workaround - disable passing request's header Expect: 100-continue on proxy as described here http://www.squid-cache.org/Versions/v3/3.1/cfgman/ignore_expect_100.html

Yuriy Alevohin
  • 941
  • 7
  • 18
  • Thanks very much for the detailed response. I will try this out and let you know. I'm only using CNTLM as an authentication proxy (`localhost:3128`). – Nadee Apr 06 '18 at 06:44