-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some debugging/log-grabbing help sought. #1496
Comments
hey @fadams - you may try |
Hi again @rdallman thanks for the tip. That has helped me to discover a little more, though I'd still appreciate some pointers. What I have discovered so far.... well, as I mention in my original post I'm trying a fairly simple function based on this Dockerfile which is using hotwrap:
When I simply run the container's busybox unzip (where I have to unset the entrypoint 'cause it's using hotwrap) e.g. by doing:
or
everything is happy an my simple text zip unzips to stdout, though none of it is using Fn at that point. When I do
as I mention above it fails, but looking at the debug logs I'm seeing something interesting - they are pretty verbose so I've just included some of the key bits here - what I end up seeing is:
The main bit of interest in this is the bit:
Now bear in mind what my original Dockerfile looks like and also the previous docker run calls and not a
what I get is:
i.e. the usage message which if you pore over the Fn debug logs seems to be what I'm getting when I try to invoke this. So it looks like my problem is down to hotwrap calling my actual unzip executable via /bin/sh -c rather than directly which I suspect is then not passing stdin, which is where the hyphen in the My shell foo isn't as hot as I might like so I'd really appreciate any suggestions as to how I might rewrite the MTIA and thanks again for the logging help that identified what actually seems to be going on. |
Okey Dokey. I've made some progress, after a bit of tinkering around it seems like putting quotes round the unzip call works, that is to say:
Then I though D'oh is my problem that I'm using the shell form of CMD as described here https://docs.docker.com/engine/reference/builder/ when I've also specified ENTRYPOINT (so the CMD should really be the ENTRYPOINT parameters). I think my issue is explained under the "Understand how CMD and ENTRYPOINT interact" section in the table my ENTRYPOINT was of the form [“exec_entry”, “p1_entry”] and my CMD was of the form CMD exec_cmd p1_cmd so from the matrix the executed command was of the form exec_entry p1_entry /bin/sh -c exec_cmd p1_cmd I rewrote my Dockerfile to look like this:
and now
seems to be working and the debug logs say:
So I'm no longer seeing the One issue I'm still seeing though is an error when I try to invoke via Curl e.g.
The logs say:
Given the invoke now works this is almost certainly now an issue with how I'm invoking Curl to try and send a binary (I note in the logs "unzip: invalid zip magic 74736574" so clearly something is getting messed up) - if anybody could suggest the correct syntax for that that'd be really useful. Thanks |
I've finally got this (sorry for replying to my own posts but I figure that somebody else just might find this useful). So I really needed to RTFM the Curl manual https://curl.haxx.se/docs/manpage.html. My main problem above was using
which finally results in the unzipped text appearing on stdout, whew.... |
thanks for posting the details @fadams this may end up being useful to quite a few people. glad you got everything working. going to close since this seems resolved, except that the debugging xp can use some improvement :/ |
Hello,
I'm trying to create a simple unzip function using hotwrap. The Dockerfile looks like:
and func.yaml looks like:
To create the app and deploy the function:
So far so good and the piped unzip appears to work running the alpine busybox unzip directly in the container via:
with my simple zipped text file test.zip the above command displays the unzipped text on stdout as I'd have expected/hoped.
However when I try to invoke the deployed function:
I see
similarly if I use Curl
TBH I'm not really sure the best way to go about figuring out what has gone wrong, I'h have guessed that the zip file is somehow not being sent as binary, though I am using --data-binary in the Curl call, though it's possible that hotwrap might be munging the binary, but TBH I've no clue how that works or to work out if that is indeed the case.
I came across this post https://medium.com/fnproject/sending-function-logs-to-papertrail-c1ba2bae62e6 that has some info on getting function logs, however when I do:
I get
so I'm wondering if something has changed in the way function logs are retrieved since that article was written?
I'd really appreciate any help suggesting what I might be doing wrong, even some pointers to help get some more useful info than just "error running exec: exit status 1".
MTIA
The text was updated successfully, but these errors were encountered: