Comments (5)
@fundef1 thank you for the report, unfortunately, I have been working on this already for the last couple of weeks. I have made some progress in #93, but not enough to actually close this.
One of the issues seems to be an unfortunate behavior where faasd code would try to read logs from the journalctl
output before journalctl
had written any output. This is probably what you are seeing now
The code (once cleaned up) in #93 addresses this issue.
However, there seems to be another issue also happening.
In some personal branches, i have added additional logging in faasd and the gateway code. I have determined that
- the faasd log provider does correctly tail the logs,
- that it correctly sends the logs to the faasd log handler
- the log handler correctly sends the logs to the gateway and
- the gateway log handler correctly writes the logs to the ResponseWriter as they are received.
Basically, everything inside the openfaas authored code is working (or can at least log the expected log line at each moment)
It seems like there might be some kind of buffering on the response writer. For example, seems to hold the last line of the logs for some time and I can not determine the exact way to force it to actually flush to the client. Note that we already use the Flusher interface. I have been able to get it to "tail" the logs by just spamming the function with invocations. Eventually it does send logs, but it takes 15 -- 20s for each batch.
To me, the fact that the Gateway sees and is able to log every expected function log line suggests that is some bug (a missing config or header) in the Gateway or with how faasd configures the provider server.
from faasd.
@LucasRoesler is right, there's something we're looking into that is making the CLI's logs feature fail in some circumstances.
Here's a workaround that you can use to access logs:
export NAME="figlet"
journalctl -t openfaas-fn:$NAME
You'll need to run it over SSH or SSH into the faasd host to execute it.
from faasd.
Thanks for the update. Good to know it's not something on my end.
from faasd.
@alexellis this is how I was debugging the issue up to the gateway
Update the gateway image to use docker.io/theaxer/gateway:508b17b6
, it is based on this branch
sudo vim /var/lib/faasd/docker-compose.yaml
Deploy the branch version of faasd
make local \
&& sudo pkill -9 faasd \
&& sudo cp bin/faasd /usr/local/bin
Stop the faasd components and restart
sudo systemctl stop faasd
sudo -i
cd /var/lib/faasd
pkill faasd && faasd up
and
sudo -i
cd /var/lib/faasd-provider
faasd provider
Redeploy the function to avoid any networking issues
faas-cli deploy --image=functions/nodeinfo-http:latest --name=nodeinfo
faas-cli invoke nodeinfo <<< "" && date
faas-cli logs nodeinfo
Get the raw logs response using curl
curl -u "$(sudo cat /var/lib/faasd/secrets/basic-auth-user):$(sudo cat /var/lib/faasd/secrets/basic-auth-password)" -v -H "Connection: keep-alive" "http://localhost:8080/system/logs?follow=true&name=nodeinfo&tail=-1"
from faasd.
I think this can be closed now. @fundef1 please can you retest? I'll reopen the issue if it's still a problem in the latest version
from faasd.
Related Issues (20)
- Issues with rust HOT 1
- Access host's network from a docker-compose.yaml's service HOT 5
- Support request for Docker installed with faasd (invalid) HOT 5
- Can docker-compose be used with faasd? HOT 8
- Support question on MQTT HOT 4
- Executing install.sh fails because of wrong version HOT 1
- Grafana installation - volume permissions HOT 2
- Multi-node support HOT 3
- Support request for monitoring with cAdvisor HOT 6
- NATS JetStream support HOT 2
- disable printing function invocation duration
- Terrraform install fails on macOS Sonoma HOT 2
- faasd and faasd provider in different ports HOT 1
- faasd namespace support openfaas=true instead of openfaas=1
- Is Scale to Zero included in the Community Edition of OpenFaaS? HOT 8
- support faasd get HOT 1
- Postgresql database connection problem HOT 16
- MemoryLimit needs changing to: MemoryMax
- Deprecate 32-bit Arm support HOT 1
- Additional property postgresql is not allowed HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faasd.