Hi,

We have found an issue/bug/feature in how two different versions of
Mojolicous return data.

We are unclear if this is our fault, is by design, is an issue or is a bug.
We aren't arrogant enough not to think it isn't us :)

We have two servers, a local test server and a pre-pre production server.
The local test server was installed last year and works the way we expect
and have coded for, we've just stood up the pre-production server and that
exhibits slightly different behaviour and we'd love to know why.

We'll show this with a simple example.

Both servers are running identical code. We've checked this and md5sum'ed
the output. (yes we know md5sum isn't technically reliable over many
trillions of files, for us and two files, its reliable enough).

Each server has hypnotoad running and our perl scripts. Each returns the
following information. (This exact code is working in production and has
been for > 12 months, so we know it works OK.)
-------------------
get '/' => sub {

    # Lots of lines removed

    $log = $log->debug("Get returning = ".Dumper($status));

    $self->render(text => $status->{text} ,
                  status => $status->{status} ,
                  json => $status->{json} ? $status->{json} : {}
        );
};
-------------------

if we look at the log file we keep we can see

-------------------
[Wed Mar 15 13:24:59 2017] [debug] Get returning = $VAR1 = {
          'status' => 200,
          'text' => 'OK',
          'json' => {}
        };
-------------------

This is the correct response for us and works on our local test server and
on our production server.

If we use a web browser to directly connect to the local hypnotoad test
server

https://<<REDACTED URL1>>:3000/user?Verb=GetNotifications&UUID=<<REDACTED>>

we get the response displayed as

{}

If we use a web browser to directly connect to the newly created
pre-production server

https://<<REDACTED URL2>>:3000/user?Verb=GetNotifications&UUID=<<REDACTED>>

we get the response displayed as

OK

The only difference between the two systems (that we can find) is the
version of Mojolicious

The local test server is running

-------------------
root@demonotifications:/usr/local/bin# mojo version
CORE
  Perl        (v5.18.2, linux)
  Mojolicious (7.01, Doughnut)

OPTIONAL
  EV 4.0+                 (n/a)
  IO::Socket::Socks 0.64+ (n/a)
  IO::Socket::SSL 1.94+   (n/a)
  Net::DNS::Native 0.15+  (n/a)

You might want to update your Mojolicious to 7.29!
-------------------

The more recent pre-production server is running

-------------------
root@preprod-notifications:/usr/local/bin# mojo version
CORE
  Perl        (v5.18.2, linux)
  Mojolicious (7.24, Doughnut)

OPTIONAL
  EV 4.0+                 (n/a)
  IO::Socket::Socks 0.64+ (n/a)
  IO::Socket::SSL 1.94+   (n/a)
  Net::DNS::Native 0.15+  (n/a)

You might want to update your Mojolicious to 7.29!
-------------------

We have checked that the versions of Nginx are the same which acts as an
SSL proxy and that the configuration of the Nginx server is the same (the
differences are the names of the server redirection in the Nginx
configuration file).

All the servers are running Ubuntu 14.04 LTS.

So it appears that more recent versions of Mojolicious have changed
something so that we get the 'OK' back rather than the empty JSON we are
expecting.

This is puzzling and we're trying to work out why.

Since the latest cpanm for Mojolicious appears to be 7.24 we are very wary
of changing something that works on production servers.

Any advice or help welcomed, even if its to point out that we have been
foolish and missed something.

Thanks

Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to