Nginx reverse proxying seaside problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Nginx reverse proxying seaside problem

laurent laffont

Hi,

 

I have a simple seaside page, pharo 20, ZnZincServerAdaptor, Nginx on front, configuration:

 

server {

listen 80;

server_name myserver.mydomain.fr;

 

location / {

proxy_pass http://localhost:8085;

}

}

 

 

It works except on this code in a

 

WAComponent subclass: #MyForm

renderContentOn:html

.....

.....

html submitButton

callback: [self answer: site];

value: 'Save'.

 

 

when I click the save button, Nginx raises 502 Bad Gateway error. In error log:

 

 

"557 upstream prematurely closed connection while reading response header from upstream"

 

Any idea ?

 

Regards,

 

Laurent


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Nginx reverse proxying seaside problem

Johan Brichau-2
Nginx is telling you that the backend died.

Since you are not reporting any Seaside exception handler popping up, it may be the Zinc adaptor.
Can you check that you have the latest Zinc adaptor?

Also: which version of Seaside are you using?

Johan

On 26 Mar 2014, at 13:03, Laurent Laffont <[hidden email]> wrote:

> Hi,
>  
> I have a simple seaside page, pharo 20, ZnZincServerAdaptor, Nginx on front, configuration:
>  
> server {
>     listen   80;
>     server_name myserver.mydomain.fr;
>  
>     location / {
>         proxy_pass  <a href="http://localhost:8085;">http://localhost:8085;                                                                                           
>     }
> }
>  
>  
> It works except on this code in a
>  
> WAComponent subclass: #MyForm
>   renderContentOn:html
>     .....
>     .....
>        html submitButton
> callback: [self answer: site];
> value: 'Save'.
>  
>  
> when I click the save button, Nginx raises 502 Bad Gateway error. In error log:
>  
>  
> "557 upstream prematurely closed connection while reading response header from upstream"
>  
> Any idea ?
>  
> Regards,
>  
> Laurent
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Nginx reverse proxying seaside problem

laurent laffont

Thanks Johan,

 

I use Seaside 3.1.1, Zinc-Seaside-SvenVanCaekenberghe.40 (.41 seems to be a minor change but I will try)

 

Laurent

 

Le mercredi 26 mars 2014, 13:50:14 Johan Brichau a écrit :

> Nginx is telling you that the backend died.

>

> Since you are not reporting any Seaside exception handler popping up, it may be the Zinc adaptor.

> Can you check that you have the latest Zinc adaptor?

>

> Also: which version of Seaside are you using?

>

> Johan

>

> On 26 Mar 2014, at 13:03, Laurent Laffont <[hidden email]> wrote:

>

> > Hi,

> >

> > I have a simple seaside page, pharo 20, ZnZincServerAdaptor, Nginx on front, configuration:

> >

> > server {

> > listen 80;

> > server_name myserver.mydomain.fr;

> >

> > location / {

> > proxy_pass http://localhost:8085;

> > }

> > }

> >

> >

> > It works except on this code in a

> >

> > WAComponent subclass: #MyForm

> > renderContentOn:html

> > .....

> > .....

> > html submitButton

> > callback: [self answer: site];

> > value: 'Save'.

> >

> >

> > when I click the save button, Nginx raises 502 Bad Gateway error. In error log:

> >

> >

> > "557 upstream prematurely closed connection while reading response header from upstream"

> >

> > Any idea ?

> >

> > Regards,

> >

> > Laurent

> > _______________________________________________

> > seaside mailing list

> > [hidden email]

> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

>

 


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Nginx reverse proxying seaside problem

Sven Van Caekenberghe-2

On 26 Mar 2014, at 14:37, Laurent Laffont <[hidden email]> wrote:

> Thanks Johan,
>  
> I use Seaside 3.1.1, Zinc-Seaside-SvenVanCaekenberghe.40  (.41 seems to be a minor change but I will try)

That won't make much difference. I do assume you run the latest Zinc in Pharo 2 ?

I have a similar setup and it works perfectly. It would be terrible if a simple callback would not work.

There must be another reason, some configuration mismatch some where. I guess you can access the running Seaside image directly with success, right ?

> Laurent
>  
> Le mercredi 26 mars 2014, 13:50:14 Johan Brichau a écrit :
> > Nginx is telling you that the backend died.
> >
> > Since you are not reporting any Seaside exception handler popping up, it may be the Zinc adaptor.
> > Can you check that you have the latest Zinc adaptor?
> >
> > Also: which version of Seaside are you using?
> >
> > Johan
> >
> > On 26 Mar 2014, at 13:03, Laurent Laffont <[hidden email]> wrote:
> >
> > > Hi,
> > >  
> > > I have a simple seaside page, pharo 20, ZnZincServerAdaptor, Nginx on front, configuration:
> > >  
> > > server {
> > >     listen   80;
> > >     server_name myserver.mydomain.fr;
> > >  
> > >     location / {
> > >         proxy_pass  <a href="http://localhost:8085;">http://localhost:8085;                                                                                           
> > >     }
> > > }
> > >  
> > >  
> > > It works except on this code in a
> > >  
> > > WAComponent subclass: #MyForm
> > >   renderContentOn:html
> > >     .....
> > >     .....
> > >        html submitButton
> > > callback: [self answer: site];
> > > value: 'Save'.
> > >  
> > >  
> > > when I click the save button, Nginx raises 502 Bad Gateway error. In error log:
> > >  
> > >  
> > > "557 upstream prematurely closed connection while reading response header from upstream"
> > >  
> > > Any idea ?
> > >  
> > > Regards,
> > >  
> > > Laurent
> > > _______________________________________________
> > > seaside mailing list
> > > [hidden email]
> > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
>  
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Nginx reverse proxying seaside problem

laurent laffont

Found it. The problem is on the image side. The problem is that on 'Save' some code was sending:

 

Smalltalk saveSession.

 

(persistency of the poor ;)

 

that works in Pharo 1.1 but not Pharo >= 2.0 it seems (using the same vm).

 

Laurent

 

 

Le mercredi 26 mars 2014, 15:09:16 Sven Van Caekenberghe a écrit :

>

> On 26 Mar 2014, at 14:37, Laurent Laffont <[hidden email]> wrote:

>

> > Thanks Johan,

> >

> > I use Seaside 3.1.1, Zinc-Seaside-SvenVanCaekenberghe.40 (.41 seems to be a minor change but I will try)

>

> That won't make much difference. I do assume you run the latest Zinc in Pharo 2 ?

>

> I have a similar setup and it works perfectly. It would be terrible if a simple callback would not work.

>

> There must be another reason, some configuration mismatch some where. I guess you can access the running Seaside image directly with success, right ?

>

> > Laurent

> >

> > Le mercredi 26 mars 2014, 13:50:14 Johan Brichau a écrit :

> > > Nginx is telling you that the backend died.

> > >

> > > Since you are not reporting any Seaside exception handler popping up, it may be the Zinc adaptor.

> > > Can you check that you have the latest Zinc adaptor?

> > >

> > > Also: which version of Seaside are you using?

> > >

> > > Johan

> > >

> > > On 26 Mar 2014, at 13:03, Laurent Laffont <[hidden email]> wrote:

> > >

> > > > Hi,

> > > >

> > > > I have a simple seaside page, pharo 20, ZnZincServerAdaptor, Nginx on front, configuration:

> > > >

> > > > server {

> > > > listen 80;

> > > > server_name myserver.mydomain.fr;

> > > >

> > > > location / {

> > > > proxy_pass http://localhost:8085;

> > > > }

> > > > }

> > > >

> > > >

> > > > It works except on this code in a

> > > >

> > > > WAComponent subclass: #MyForm

> > > > renderContentOn:html

> > > > .....

> > > > .....

> > > > html submitButton

> > > > callback: [self answer: site];

> > > > value: 'Save'.

> > > >

> > > >

> > > > when I click the save button, Nginx raises 502 Bad Gateway error. In error log:

> > > >

> > > >

> > > > "557 upstream prematurely closed connection while reading response header from upstream"

> > > >

> > > > Any idea ?

> > > >

> > > > Regards,

> > > >

> > > > Laurent

> > > > _______________________________________________

> > > > seaside mailing list

> > > > [hidden email]

> > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

> > >

> >

> > _______________________________________________

> > seaside mailing list

> > [hidden email]

> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

>

 


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Nginx reverse proxying seaside problem

Paul DeBruicker
In reply to this post by Johan Brichau-2
Just for posterity and because I've spent time learning and forgetting this myself several times:

If you're using Zinc by default it will send the Smalltalk errors out as HTTP status codes, rather than have the errors pop up a debugger.  When nginx reports a 502 error its likely a Smalltalk error in your own code.  To have Zinc pass on the exceptions to a Smalltalk debugger start the Zinc server with the #debugMode: option set to true. E.g.


| adaptor server |
        adaptor := ZnZincServerAdaptor startOn: self port.
        server := adaptor default server.
        server
                register;
                debugMode: true





Johan Brichau-2 wrote
Nginx is telling you that the backend died.

Since you are not reporting any Seaside exception handler popping up, it may be the Zinc adaptor.
Can you check that you have the latest Zinc adaptor?

Also: which version of Seaside are you using?

Johan

On 26 Mar 2014, at 13:03, Laurent Laffont <[hidden email]> wrote:

> Hi,
>  
> I have a simple seaside page, pharo 20, ZnZincServerAdaptor, Nginx on front, configuration:
>  
> server {
>     listen   80;
>     server_name myserver.mydomain.fr;
>  
>     location / {
>         proxy_pass  <a href="http://localhost:8085;">http://localhost:8085;                                                                                           
>     }
> }
>  
>  
> It works except on this code in a
>  
> WAComponent subclass: #MyForm
>   renderContentOn:html
>     .....
>     .....
>        html submitButton
> callback: [self answer: site];
> value: 'Save'.
>  
>  
> when I click the save button, Nginx raises 502 Bad Gateway error. In error log:
>  
>  
> "557 upstream prematurely closed connection while reading response header from upstream"
>  
> Any idea ?
>  
> Regards,
>  
> Laurent
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

[BUG] Die on Smalltalk snapshot:andQuit: (was: Nginx reverse proxying seaside problem)

laurent laffont
In reply to this post by Sven Van Caekenberghe-2

Hi,

 

take a fresh Seaside image

ex: https://ci.inria.fr/pharo-contribution/job/Seaside/PHARO=20,VERSION=stable,VM=vm/lastSuccessfulBuild/artifact/Seaside.zip

 

ZnZincServerAdaptor startOn:8080.

 

then go to http://localhost:8080/status

 

click 'Save' => boom

 

Laurent

 

 

Le mercredi 26 mars 2014, 15:09:16 Sven Van Caekenberghe a écrit :

>

> On 26 Mar 2014, at 14:37, Laurent Laffont <[hidden email]> wrote:

>

> > Thanks Johan,

> >

> > I use Seaside 3.1.1, Zinc-Seaside-SvenVanCaekenberghe.40 (.41 seems to be a minor change but I will try)

>

> That won't make much difference. I do assume you run the latest Zinc in Pharo 2 ?

>

> I have a similar setup and it works perfectly. It would be terrible if a simple callback would not work.

>

> There must be another reason, some configuration mismatch some where. I guess you can access the running Seaside image directly with success, right ?

>

> > Laurent

> >

> > Le mercredi 26 mars 2014, 13:50:14 Johan Brichau a écrit :

> > > Nginx is telling you that the backend died.

> > >

> > > Since you are not reporting any Seaside exception handler popping up, it may be the Zinc adaptor.

> > > Can you check that you have the latest Zinc adaptor?

> > >

> > > Also: which version of Seaside are you using?

> > >

> > > Johan

> > >

> > > On 26 Mar 2014, at 13:03, Laurent Laffont <[hidden email]> wrote:

> > >

> > > > Hi,

> > > >

> > > > I have a simple seaside page, pharo 20, ZnZincServerAdaptor, Nginx on front, configuration:

> > > >

> > > > server {

> > > > listen 80;

> > > > server_name myserver.mydomain.fr;

> > > >

> > > > location / {

> > > > proxy_pass http://localhost:8085;

> > > > }

> > > > }

> > > >

> > > >

> > > > It works except on this code in a

> > > >

> > > > WAComponent subclass: #MyForm

> > > > renderContentOn:html

> > > > .....

> > > > .....

> > > > html submitButton

> > > > callback: [self answer: site];

> > > > value: 'Save'.

> > > >

> > > >

> > > > when I click the save button, Nginx raises 502 Bad Gateway error. In error log:

> > > >

> > > >

> > > > "557 upstream prematurely closed connection while reading response header from upstream"

> > > >

> > > > Any idea ?

> > > >

> > > > Regards,

> > > >

> > > > Laurent

> > > > _______________________________________________

> > > > seaside mailing list

> > > > [hidden email]

> > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

> > >

> >

> > _______________________________________________

> > seaside mailing list

> > [hidden email]

> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

>

 


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Die on Smalltalk snapshot:andQuit: (was: Nginx reverse proxying seaside problem)

laurent laffont

Thanks Phil.

 

If I comment code in WAServerManager>>shutDown, then it works (but when I really quit the image I have to manually start the adaptor again)

 

Laurent

 

 

 

 

Le jeudi 27 mars 2014, 11:56:51 [hidden email] a écrit :

> On Thu, Mar 27, 2014 at 9:32 AM, Laurent Laffont

> <[hidden email]>wrote:

>

> > Hi,

> >

> >

> >

> > take a fresh Seaside image

> >

> > ex:

> > https://ci.inria.fr/pharo-contribution/job/Seaside/PHARO=20,VERSION=stable,VM=vm/lastSuccessfulBuild/artifact/Seaside.zip

> >

> >

> >

> > ZnZincServerAdaptor startOn:8080.

> >

> >

> >

> > then go to http://localhost:8080/status

> >

> >

> >

> > click 'Save' => boom

> >

> >

>

> Looks like it dies in:

>

> >>send: startUpOrShutDown toClassesNamedIn: startUpOrShutDownList with:

> argument

> "Send the message #startUp: or #shutDown: to each class named in the list.

> The argument indicates if the system is about to quit (for #shutDown:) or if

> the image is resuming (for #startUp:).

> If any name cannot be found, then remove it from the list."

>

> | removals errors |

> self halt.

> removals := OrderedCollection new.

> errors := OrderedCollection new.

> * startUpOrShutDownList do: [ :name | *

> * | class |*

> * class := self at: name ifAbsent: [ nil ].*

> * class isNil*

> * ifTrue: [ removals add: name ]*

> * ifFalse: [ *

> * self *

> * logStartUpErrorDuring: [ class perform: startUpOrShutDown with: argument

> ] *

> * into: errors *

> * tryDebugger: false]].*

> "Remove any obsolete entries, but after the iteration"

> startUpOrShutDownList removeAll: removals.

> ^ errors

>

> during #startUp

>

> The debugging of the method is quite hard as weird errors do pop up

>

> FWIW, the shutdown list looks like this (and I noticed that SpEnvironment

> has no '>>isPharo' (isSqueak says 'yes'). :-(

>

> .[image: Inline image 1]

>

> Phil

>

>

> >

> > Laurent

> >

> >

> >

> >

> >

> > Le mercredi 26 mars 2014, 15:09:16 Sven Van Caekenberghe a écrit :

> >

> > >

> >

> > > On 26 Mar 2014, at 14:37, Laurent Laffont <[hidden email]>

> > wrote:

> >

> > >

> >

> > > > Thanks Johan,

> >

> > > >

> >

> > > > I use Seaside 3.1.1, Zinc-Seaside-SvenVanCaekenberghe.40 (.41 seems to

> > be a minor change but I will try)

> >

> > >

> >

> > > That won't make much difference. I do assume you run the latest Zinc in

> > Pharo 2 ?

> >

> > >

> >

> > > I have a similar setup and it works perfectly. It would be terrible if a

> > simple callback would not work.

> >

> > >

> >

> > > There must be another reason, some configuration mismatch some where. I

> > guess you can access the running Seaside image directly with success, right

> > ?

> >

> > >

> >

> > > > Laurent

> >

> > > >

> >

> > > > Le mercredi 26 mars 2014, 13:50:14 Johan Brichau a écrit :

> >

> > > > > Nginx is telling you that the backend died.

> >

> > > > >

> >

> > > > > Since you are not reporting any Seaside exception handler popping

> > up, it may be the Zinc adaptor.

> >

> > > > > Can you check that you have the latest Zinc adaptor?

> >

> > > > >

> >

> > > > > Also: which version of Seaside are you using?

> >

> > > > >

> >

> > > > > Johan

> >

> > > > >

> >

> > > > > On 26 Mar 2014, at 13:03, Laurent Laffont <[hidden email]>

> > wrote:

> >

> > > > >

> >

> > > > > > Hi,

> >

> > > > > >

> >

> > > > > > I have a simple seaside page, pharo 20, ZnZincServerAdaptor, Nginx

> > on front, configuration:

> >

> > > > > >

> >

> > > > > > server {

> >

> > > > > > listen 80;

> >

> > > > > > server_name myserver.mydomain.fr;

> >

> > > > > >

> >

> > > > > > location / {

> >

> > > > > > proxy_pass http://localhost:8085;

> >

> > > > > > }

> >

> > > > > > }

> >

> > > > > >

> >

> > > > > >

> >

> > > > > > It works except on this code in a

> >

> > > > > >

> >

> > > > > > WAComponent subclass: #MyForm

> >

> > > > > > renderContentOn:html

> >

> > > > > > .....

> >

> > > > > > .....

> >

> > > > > > html submitButton

> >

> > > > > > callback: [self answer: site];

> >

> > > > > > value: 'Save'.

> >

> > > > > >

> >

> > > > > >

> >

> > > > > > when I click the save button, Nginx raises 502 Bad Gateway error.

> > In error log:

> >

> > > > > >

> >

> > > > > >

> >

> > > > > > "557 upstream prematurely closed connection while reading response

> > header from upstream"

> >

> > > > > >

> >

> > > > > > Any idea ?

> >

> > > > > >

> >

> > > > > > Regards,

> >

> > > > > >

> >

> > > > > > Laurent

> >

> > > > > > _______________________________________________

> >

> > > > > > seaside mailing list

> >

> > > > > > [hidden email]

> >

> > > > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

> >

> > > > >

> >

> > > >

> >

> > > > _______________________________________________

> >

> > > > seaside mailing list

> >

> > > > [hidden email]

> >

> > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

> >

> > >

> >

> >

> >

> > _______________________________________________

> > seaside mailing list

> > [hidden email]

> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

> >

> >

 


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside