Hi List,

I have a PL app running on a DigitalOcean droplet, behind httpGate.

The relevant entry in my 'names' file is:

   api 8888 erik /home/erik/picoLisp loves-wake-log ./pil
loves-wake-2.0/server/main.l -main -go -wait

For this project I've been experimenting with JSON Web tokens, using my
naive 'picolisp-jwt' library (https://github.com/erdg/
picolisp-jwt/blob/master/jwt.l). It's a simple wrapper around 'jwt3', a
command line utility for encoding/decoding JWTs that ships with ubuntu
16.04.

The function 'encodeJWT' works great. But the strange behavior is that
'decodeJWT' only works under very particular conditions.

If I ssh into the server and restart 'httpGate' (and stay logged in on the
remote server) everything works as expected. But as soon as I close the ssh
session, the 'decodeJWT' function breaks - even though httpGate continues
to function as expected. Everything else works, just not 'decodeJWT'.

If I log back into the server and start the app from the command line
(using the exact command from the 'names' file, executed from the same
directory), then 'decodeJWT' works again. And that's without touching the
already running 'httpGate'. But as soon as I logout, the function breaks
again.

But regardless of whether I started the server process, or httpGate did,
'decodeJWT' receives the same arguments (according to the log file).

I thought it might be something with 'jwt3', so as an experiment, I decided
to substitute the call to 'jwt3' in 'encodeJWT'/'decodeJWT' for a different
command line utility - 'pyjwt'. When I restarted httpGate, or "manually"
started the picolisp server process, everything worked. But as soon as I
logged out and let httpGate take over, both encode/decode functions were
broken.

And now my log file was littered with 'pyjwt: can't exec' - which I believe
is the same error message that 'call' will throw if it doesn't know what to
do with its arguments? It seems that calling external programs isn't
working when the process is started by httpGate.

So to summarize:

Everything works so long as I'm logged into the server and have restarted
httpGate or started the picolisp process manually (same as httpGate does).

Calling external functions is broken, once I've logged out and left
httpGate running in the background. But everything else (that doesn't call
an external program via 'in') continues to function as expected.

Any ideas as to why this might be? This one has really thrown me for a loop!

httpGate was started with 'sudo'...

I'm using a local install of picolisp 15.11 (because some of the code in
the project uses the old style namespace calls, and also because 15.11 is
the default global install in ubuntu 16.04)

Thanks,
Erik

Reply via email to