Message Boards

Error Code: 500 Internal Server Error (Only on Add Content)

Bart Devos, modified 7 Years ago.

Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
Hello,

I'm brand new to Liferay and although installation performed smoothly i run into a strange problem:
1) All features seem to work properly: adding applications, setting configuration settings, add users, and so on, except:
2) Add => Content => Add new... => <no matter what item> results in an errorcode 500
3) What i described in 1 & 2) is performed from a remote machine (url: www.someserver.be)
4) When i do the same actions on a browser on the server (url: localhost) everything works fine.
5) Server configuration: Windows 2012 / Liferay 7.0.2. Tomcat running on port 8080 but a portredirect 80=>8080 (netsh)

Note that all other links i tested worked, except for the add content (remotely).
Any help would be much appreciated.

Kind regards
Bart Devos.
thumbnail
Andrew Jardine, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Hi Bart --

That is an odd error. I did a quick scan of the portal.properties and the system.properties files and I don't see anything that shoudl be causing that. Two questions --

1. Is there an error in the log at all? (in the catalina.out I mean)

2. Is it possible that there is something at the network tier between your remote machine and the Liferay server that is blocking/killing the request?
Bart Devos, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
Andrew Jardine:
1. Is there an error in the log at all? (in the catalina.out I mean)

No there is no logging at all. I think the request doesn't even get so far.

Andrew Jardine:
2. Is it possible that there is something at the network tier between your remote machine and the Liferay server that is blocking/killing the request?


I'm afraid it is but i can't figure out what. Here is the redirect i defined with netsh.
PS C:\Users\Administrator&gt; netsh interface portproxy show all

Listen on ipv4:             Connect to ipv4:

Address         Port        Address         Port
--------------- ----------  --------------- ----------
0.0.0.0         80          192.168.250.114 8080

Or should i reconfigure Tomcat to run on port 80 instead of do a redirect?

Thank you so much for taking the time to investigate this!

Kind regards,

Bart.
thumbnail
Andrew Jardine, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Hey Bart --

Good question. I would probably start with something simpler. You mentioned that if you access the server locally (from the box itself using the loopback) it works right? What happens if you access the Liferay server directly at 192.168.250.114 8080 -- does it let you add content then?

If it still doesn't then it means that the problem is likely on the server or through a common gateway that you workstation and the proxy pass through. If it DOES work, then you know that the issue lies at the proxy itself.

If you can, try to hit the box directly and let me know what happens.
Bart Devos, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
Hi Andrew,

Thanks for your insights! I answered your questions after the quotes:
You mentioned that if you access the server locally (from the box itself using the loopback) it works right?

Correct
What happens if you access the Liferay server directly at 192.168.250.114 8080 -- does it let you add content then?

I can't. This is a rented VPS server. The 192 address is the lan address. I access it thru the assigned url: www.krombekehoek.be. Using the corresponding ip address makes no difference. I could access it thru the 192 address if i installed VPN, but then i'll add another layer with possible difficulties. If you want to play around on www.krombekehoek.be, please feel free. It's just the basic installation with the basic test user and password. There are no nuclear codes installed (yet)... ;-)

I'll try following things:
1) Run Tomcat on port 80 directly and get rid of the port forwarding
2) Re-install Liferay

What puzzles me is that i can't imagine that the http requests for adding content are different in anyway than the other requests. Are there other parameters than URL and port that make a difference? You are right that the problem is situated between the WAN and the LAN part of the server, but just for that particular set of requests, not the others.
I'm continuing testing and keep you (and the forum) informed. Thank you very much for your concern!

Bart Devos.
Bart Devos, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
Hi Andrew,

I tested with Tomcat's port configured to port 80. The problem remains the same. But something occurred to me while altering the port:
<connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" [b]redirectPort="8443" [ b] URIEncoding="UTF-8" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
              [b] redirectPort="8443"[/b] URIEncoding="UTF-8" />
    -->

There is a redirectPort parameter and i don't fully understand the meaning of it. I have no clue if that something has to do with the issue.
Meanwhile i asked technical support of the VPS if there is an additional security layer on top of the servers firewall and apparently there is. I asked them if that means that every time i want to enable a port i have to ask them to open it. I'll expect an answer in short notice. Perhaps i should ask to open that port 8443. I'll let you know.

Kind regards,

Bart.
thumbnail
Andrew Jardine, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
That redirect port is a red herring. If memory serves me, it just means tha any https traffic that is received by tomcat on port 80 will be forwarded to port 8443.

I didn't expect the change in destination port to matter, having a proxy at port 80, terminating SSL there, and then forwarding to 8443 is a bread and butter kinda setup.

I'll have a look, but no guarantee if I will have a chance to look before the 27th. This isn't the best weekend to solicit help. It is a good weekend to say Merry Christmas though emoticon
thumbnail
Andrew Jardine, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Update: My family is still asleep so I thought I would have a quick look. I was able to add a new piece of Basic Web Content (which I left there for you to see). It was a weird experience though.

1. I went to the URL you gave me and used the test credentials to log in
2. I expanded the left hand drawer
3. I click on Content

.. at this stage no matter what link I clicked, nothing happened. My browser (tag) actually felt hung, so I closed the tab and opened a new one. I was already logged in of course (cookies are still there). This time I ...

4. expanded the drawer
5. clicked on Web Content

this time it highlighted and in the main canvas the web content management loaded.

6. Click the + in the lower right
7. Chose Basic Web Content

The form loaded, but it was all disabled. So I redid the steps...

8. Clicked on Web Content
9. Clicked on the + in the lower right
10. Chose Basic Web Content

And this time form fields were active. I filled them in and saved the content.

I did notice that it is PAINFULLY slow. Like things that should take a second or two were taking like 8 - 10. I didn't see any 500 errors when I was doing it but I thought maybe, for the cases where things didn't work, there was a timeout or something happening. It's really hard to say without having all the config files, rules etc.
Bart Devos, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
Thank you Andrew for still working on the problem. I much appreciate it.
It is slow indeed, but i ordered a VPS memory upgrade and a multi core processor. I expect they will do the upgrade before tonight.
Well the one thing i didn't try was to use another browser... Shame on me.
I'll do some further testing and keep you informed.

Thanks!

Bart.
Bart Devos, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
And the quest goes on... ;-)
What i did until now (with the fact in mind that it works on your side, although slow) with the same error 500 result:
1) Tried different browsers
2) Tried different client stations inside my lan (Windows and Mac alike)
3) Tried with mobile tethering on my pc in order to bypass the router settings on the client side
4) Disabled the firewall on the client and the server machine
5) Set the browser locale on en_US instead of nl_BE (remember, it worked on your side with probably that browser locale)
6) Re-installed Liferay completely on the server, now not running as a service but in a PowerCmd console (more manageable)

Meanwhile the provider upgraded the VPS.

What i tried with partially success:
1) Captured the actual request string from both the browser on client-side and server-side
2) Did a diff on both strings and apart from the domain name (localhost vs krombekehoek) nothing differed.
3) As the request is embedded in a javascript command the URI encoding was passed in a \x<hex> notation for the special characters.
4) I replaced manually all \x<hex> notations by its corresponding character.
5) I passed the string to my client browser and it worked!

I encountered something odd while replacing those strings:
At start the URI was coded logically, i.e. : http\x3a\x2f\x2fwww\x2ekrombekehoek for http://www.krombekehoek
further on the notation was more 'nested': \x252Fdocument for /document. So \x<hex> notation is changed in a %<hex> notation and then on to the actual asscii value: \x252Fdocument => %2Fdocument => /document.
It goes even more nested: \x25252F for finally /
Although i don't think it is wrong, it's a weird notation. Again, the string on the server side and the client side are equal for that matter.
Another thought: As the resolved request string works, how could it be a firewall/other security layer issue?

So i still didn't find a practical solution. I attached both request strings as i copied then from the browser.

Kind regards,

Bart.
Bart Devos, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
Unfortunately i have to leave Liferay as a solution for what i want to achieve. My final goal was to embed an existing OpenXava application into a Liferay portal. Almost by accident i read a forum thread on the OpenXava forum that OX dropped support for LR since version 6.2 of LR. So i'm afraid that this is not the way to go for me.
Sorry to have wasted your time with this issue (although it's a 'real' problem that still is not resolved), but there is no point for me to investigate it further.

Kind regards.

Bart Devos.
Bart Devos, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
Of course Andrew, it's holiday time! Many wishes for Christmas and enjoy the family moments.
Meanwhile i did some further investigation and found out the following:
1) Indeed the VPS provider has to open the ports as well, so there is an extra security layer. Nevertheless port 80 is open by default, so this is not an issue.
2) I installed a port sniffer on both client and server side (Wireshark, great tool by the way).
3) On server side nothing came in the moment i do the add content request. This was expected.
4) On client side i captured the stream the moment i do the add content request and i captured the stream the moment i do a "add (Application) breadcrumb" request. (to be able to compare).
5) Apart from the error 500 there is another difference: In the request without the error there is a redirection from port 80=>60147 & 60148. In the problem request there is a redirection from port 80 => 60090 & 60101. Googling learned me that port 60101 is considerated as a threat for "stealers". Perhaps the VPS provider blocked that specific port.
6) If you find the time (after Christmas of course), please have a look at the attached Wireshark trace files. There is a "ProblemRequest" and a "SuccessRequest" file. I'm not sure if my interpretation is right.
7) If i'm right, how can i influence the use of those 60000+ ports, so Tomcat uses only trusted ports?

Thank you so much for taking the time.

Kind regards

Bart Devos.
thumbnail
Andrew Jardine, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Hey Bart,

Sorry to hear that. I'm no expert in OpenXava, but from what I am reading on the homepage of the site, I don't see anything special that would make it "not work" in Liferay 7. In fact, I would assume that the new model with the service registry in the OSGI container would make it easier to write an application using this framework -- which looks like, in part, is an alternate to using the native Liferay Service Builder tools.

One of the things that I think Liferay has really embraced starting in 7 is the original idea of the "portal solution" -- allowing people to build and integrate using whatever technologies they want (or are mandated) to use. With that said, sometimes these frameworks aren't designed to make the best use of what the portal offers and really you end up trying to shove a square peg into a round hole.

Best of luck -- hopefully you find yourself coming back to Liferay at some point in the future -- it really is an incredible platform with unparalleled developer tools and support, once you get over the initial hump.
Bart Devos, modified 7 Years ago.

RE: Error Code: 500 Internal Server Error (Only on Add Content)

New Member Posts: 15 Join Date: 12/23/16 Recent Posts
Hi Andrew,

I have no doubt that Liferay is a very solid platform. The former integration of OX and LR concerned mainly the access by user/role. As OX also offers that in their (payed) pro version it conflicted with their business model i guess.
Probably it could be possible to integrate it anyway but it must be worth the effort.
Thank you very much for your time!

Kind regards,

Bart.