SeasideSt / Seaside

The framework for developing sophisticated web applications in Smalltalk.
MIT License
519 stars 71 forks source link

500 error for sessionprotected-counter #1439

Open mengelhart opened 3 months ago

mengelhart commented 3 months ago

I'm just starting to teach myself Seaside (and still very much learning Smalltalk) and was browsing the example applications just now and noticed the sessionprotected-counter example doesn't work and returns a 500 Internal Server error when running in Squeak 6.0 (current release) in the current release of Seaside that was pulled down when I just installed it the other day (v 3.5.9). As I get more comfortable I'll see if I can determine what's causing this.

WACookie(Object)>>doesNotUnderstand: #oldNetscapeString
    Receiver: a WACookie
    Arguments and temporary variables: 
        aMessage:   oldNetscapeString
        exception:  MessageNotUnderstood: WACookie>>oldNetscapeString
        resumeValue:    nil
    Receiver's instance variables: 
        key:    'seaside_browser_session'
        path:   '/examples/sessionprotected-counter'
        pathEncoded:    '/examples/sessionprotected-counter'
        domain:     nil
        ports:  nil
        value:  'lXGukUzHCA_a74vnuf4F'
        version:    1
        expiry:     nil
        secure:     false
        discard:    false
        comment:    nil
        commentUrl:     nil
        httpOnly:   true
        sameSite:   'Strict'
        maxAge:     nil

[] in WAWebServerAdaptor>>responseFrom:
    Receiver: a WAWebServerAdaptor
    Arguments and temporary variables: 
        aRequestContext:    a WARequestContext url: 'http://localhost:8080/examples/sessio...etc...
        response:   WebResponse(HTTP/1.1 302 Moved Temporarily

Location: http://localhos...etc...
        cookie:     a WACookie
    Receiver's instance variables: 
        manager:    a WAServerManager
        port:   8080
        requestHandler:     nil
        codec:  a GRPharoUtf8Codec name: 'utf-8'
        server:     a WebServer
        certName:   nil

OrderedCollection>>do:
    Receiver: an OrderedCollection(a WACookie)
    Arguments and temporary variables: 
        aBlock:     [closure] in WAWebServerAdaptor>>responseFrom:
        index:  1
    Receiver's instance variables: 
        array:  {a WACookie . nil . nil . nil . nil . nil . nil . nil . nil . nil}
        firstIndex:     1
        lastIndex:  1

WAWebServerAdaptor>>responseFrom:
    Receiver: a WAWebServerAdaptor
    Arguments and temporary variables: 
        aRequestContext:    a WARequestContext url: 'http://localhost:8080/examples/sessio...etc...
        response:   WebResponse(HTTP/1.1 302 Moved Temporarily

Location: http://localhos...etc...
    Receiver's instance variables: 
        manager:    a WAServerManager
        port:   8080
        requestHandler:     nil
        codec:  a GRPharoUtf8Codec name: 'utf-8'
        server:     a WebServer
        certName:   nil

[] in [] in WAWebServerAdaptor(WAServerAdaptor)>>process:
    Receiver: a WAWebServerAdaptor
    Arguments and temporary variables: 
        aNativeRequest:     WebRequest(GET /examples/sessionprotected-counter HTTP/1.1

hos...etc...
        context:    a WARequestContext url: 'http://localhost:8080/examples/sessionprotect...etc...
    Receiver's instance variables: 
        manager:    a WAServerManager
        port:   8080
        requestHandler:     nil
        codec:  a GRPharoUtf8Codec name: 'utf-8'
        server:     a WebServer
        certName:   nil

--- The full stack ---
WACookie(Object)>>doesNotUnderstand: #oldNetscapeString
[] in WAWebServerAdaptor>>responseFrom:
OrderedCollection>>do:
WAWebServerAdaptor>>responseFrom:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[] in [] in WAWebServerAdaptor(WAServerAdaptor)>>process:
[] in WACurrentRequestContext class(DynamicVariable class)>>value:during:
FullBlockClosure(BlockClosure)>>ensure:
WACurrentRequestContext class(DynamicVariable class)>>value:during:
WACurrentRequestContext class(GRDynamicVariable class)>>use:during:
[] in WARequestContext>>push:during:
FullBlockClosure(BlockClosure)>>ensure:
WARequestContext>>push:during:
[] in WAWebServerAdaptor(WAServerAdaptor)>>process:
FullBlockClosure(BlockClosure)>>ensure:
WAWebServerAdaptor(WAServerAdaptor)>>process:
WAWebServerAdaptor>>process:
MessageSend>>valueWithArguments:
WebServer>>invokeAction:request:
[] in WebServer>>dispatchRequest:url:
FullBlockClosure(BlockClosure)>>on:do:
WebServer>>dispatchRequest:url:
WebServer>>dispatchRequest:
[] in WebServer>>handleConnectionFrom:
FullBlockClosure(BlockClosure)>>on:do:
WebServer>>handleConnectionFrom:
[] in [] in [] in WebServer>>asyncHandleConnectionFrom:
FullBlockClosure(BlockClosure)>>on:do:
[] in [] in WebServer>>asyncHandleConnectionFrom:
FullBlockClosure(BlockClosure)>>ensure:
[] in WebServer>>asyncHandleConnectionFrom:
[] in FullBlockClosure(BlockClosure)>>newProcess

-----------------------------------------------------------------

VM: Mac OS - Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3339] 64 bit
Image: Squeak6.0 [latest update: #22149]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
jbrichau commented 3 months ago

Hi, thanks for reporting. Unfortunately, the Squeak port of Seaside is not very well maintained anymore. As you may have noticed, the builds are failing for Squeak. If you are dabbling with Seaside, I recommend using Pharo Smalltalk.

I will keep the issue, in case anyone who uses Squeak with Seaside picks it up and fixes it. This is an issue in the server adaptor for the http server in Squeak only.

mengelhart commented 3 months ago

Thanks @jbrichau . I'm new to working Smalltalk and am not too keen on using Pharo at the moment. I'm still just teaching myself Smalltalk so I don't have a huge need for building major web applications at this point and most of Seaside appears to work (e.g. I can go through the tutorials I've found so far without any problems). But yes if you could keep it open maybe I'll get to the point where I can commit a PR to fix :)

mengelhart commented 3 months ago

Also I was looking into the open issues and there appears to be a Platform Squeak label - are issues with Squeak generally labeled as such. I'm just trying to get a sense of many issues there are to tackle. I would hate to see Squeak support stop because that list gets too big for anyone to handle in their spare time. I'd love to get proficient enough on this to help out!

marschall commented 1 month ago

I think this is a duplicate of #1392

WebClient-Seaside-Adaptor-pmm.3.mcz from https://ss3.gemtalksystems.com/ss/WebClient.html should fix it.