RE: RE: 7.3 CE GA6 - Problem adding basic content with link behind a proxy

thumbnail
Fernando Fernandez, modified 4 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts
Hi guys,
I'm playing with the latest and greatest but I'm having a problem: whenever I create a web content with a link I'm unable to save the webcontent due to an unspecified error ("Error: Your request failed to complete"). No errors show up on the console.
I suspect this has to do with the server being behind a proxy with no direct internet access, because on a normal situation this does not happen. But I have configured the proxy settings on system-ext.prperties, as recommended by Jorge Diaz on Stack Overflow.
Any ideas on how I can debug this? What classes' logs should be enabled?
TIA
Fernando
thumbnail
Christoph Rabel, modified 4 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
I guess, this error is only visible in the browser, you won't see anything in the backend. So, open the browser development tools (usually with F12 in Firefox/Chrome) and check for:
- Connection errors in the network tab
- Errors in the console tab
Errors (404 or something) in the network tab could be related to a proxy. If you have a connection error, you probably can just ignore errors in the console tab since they are probably caused by the connection error.
thumbnail
Fernando Fernandez, modified 4 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts
Thanks Christoph.  

Unfortunately on the browser side I only get some (seemingly) unreated warnings like:
 
"Component with id "_com_liferay_journal_web_portlet_JournalPortlet_ddmForm" is being registered twice. This can lead to unexpected behaviour in the "Liferay.component" and "Liferay.componentReady" APIs, as well as in the "*:registered" events"

I'm still gessing that this is a proxy/network related problem, since I cannot reproduce it on a non-proxied Liferay+browser. I'd like to confirm that the proxy I configured on system-ext.properties is working. I've checked on Control Panel and the properties are being read, but I'd like to confirm they're being used.

My system-ext.properties  currently reads like this:
http.proxyHost=172.18.2.102
http.proxyPort=8080
http.nonProxyHosts=*.not-real-domain.org|localhost
Any ideas?

TIA

Fernando
thumbnail
Christoph Rabel, modified 4 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
So, you access your server  with the following url:
http://172.18.2.102:8080
Right? Or do you use a hostname? In general: I would not do it this way, I would try to configure my proxy to send an X-Header and let Liferay us that one. It works pretty well for me, I only have to tell the tomcat that it should use the https scheme.

Do you see any warnings/errors in the proxy logfile?
You could try to enable logging for this class:
com.liferay.journal.web.internal.portlet.action
(Try it without proxy too, to check if it indeed gives you some output)
thumbnail
Fernando Fernandez, modified 4 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts

Just a small update on this:

 

I access the liferay server with IP or localhost. The behaviour is the same with or without the proxy configuration. I've tested the proxy with an rss feed on a page and everything was working. I have no access to the proxy logs, unfortunately.

 

The behaviour is like this: a) If I create a basic webcontent with no links, I can save it normally; b) If I create a basic webcontent with a link to http://localhost, I can save it normally; c) If I create a basic webcontent with a link to http://www.google.com I get that generic error and the webcontent is not saved. No messages go into the log.

 

On Control Panel, I've disabled the Infrastructure / Import/Export / Validate Missing references option but it changes nothing.

 

I've activated debug logging for the com.liferay.journal.web.internal.portlet.action.UpdateArticleMVCActionCommand class and confirmed it's being called. I've looked at the code on github and tried to follow the path. I got to the method validateContentReferences() on com.liferay.journal.internal.exportimport.content.processor.JournalArticleExportImportContentProcessor and enabled debug on the class but either it's not that class or it's not called.

 

I'm suspecting that the url validation is being done through hostname checking and not by a connection to the url, but I was unable to confirm until now (I'm waiting for the sysadm to enable DNS on the machine).

 

 

 

thumbnail
Fernando Fernandez, modified 4 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts

Good news. It was not a proxy problem but a DNS problem.

Apparently, Liferay is testing the hostname on the link instead of the full URL.

Since the server was just relying on the proxy but had no DNS config, the validation was failing.

The prolem went away after correct DNS configuration on the host.

Thanks for the suggestions, Christoph!