Hello, I have tried to call Kudu API from Powershell using Invoke-RestMethod and it throws timeout randomly, so I would like if exist a way to recovery the logs of API calls to Kudu.
Thanks in advance.
Check the D:\home\LogFiles\kudu\trace folder from Kudu Console.
D:\home\LogFiles\kudu\trace doesn't keep that information, What could am I missing?
You mean you don't see any log file at all for these calls? What specific API are you calling? It might make sense to open an issue focused on the problem you're having rather than on the log.
I am calling exactly to api/command and I call commands for restoring npm packages, composer packages, or that kind of commands that could take a long time.
What I already tried:
-TimeoutSec 600 in Invoke-RestMethodSCM_COMMAND_IDLE_TIMEOUT = 600Things I know:
Things I don't know:
Things I think could work.
Why I need this behavior:
I hope to be more clear on this occasion, let me know if is necessary open another issue. Thanks in advance for your assistance.
A couple questions:
Also, when you say that "D:\home\LogFiles\kudu\trace doesn't keep that information", do you mean that you don't see any trace files in that folder? Or you see some for some operations but not the ones at stake here?
Hi David,
api/command calls into log files.Is it expected this it would take this long? This API is not really designed for starting very long operations and waiting for them. Unfortunately, the 230s timeout is not something Kudu can change.
One approach some have used is to create your own async pattern. e.g.
Not super pretty but can be made to work.
We have hacked around the issue by running in azure the following commands:
# Clean old files
del composer_update_*.txt
# Start composer (we just let it timeout and redirect output and exit code to files)
composer update 1> composer_update_output.txt 2> composer_update_error.txt & echo %errorLevel% > composer_update_exitcode.txt
# Then we actively wait until exitcode file exist as a flag on execution end
if exist composer_update_exitcode.txt (echo exit) else (echo still running)
# Then we get the data from files
type composer_update_output.txt
type composer_update_error.txt
type composer_update_exitcode.txt | find "0"
# And finally we clean the environment
del composer_update_*.txt
It would be nice to have a less hacky way to run a command async.
Hope this helps someone.
Awesome!!! Thanks @axelwass I'll try it :)
Most helpful comment
Is it expected this it would take this long? This API is not really designed for starting very long operations and waiting for them. Unfortunately, the 230s timeout is not something Kudu can change.
One approach some have used is to create your own async pattern. e.g.
Not super pretty but can be made to work.