You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to access the logs of my (failed) jobs, but I think the docs are slightly outdated and/or I'm doing things wrong.
Attempt 1:
In the docs it's mentioned that you can get the logs by doing kbatch job logs CONTAINER_ID
"""
With kbatch job logs you can get the logs for a job. Make sure to pass the container id.
'''"
I don't think the current version has a logs argument for the job command. The command I see for job are delete, list, show and submit; see help message below:
kbatch job --help
Usage: kbatch job [OPTIONS] COMMAND [ARGS]...
Manage kbatch jobs.
Options:
--help Show this message and exit.
Commands:
delete Delete a job, cancelling running pods.
list List all the jobs.
show Show the details for a job.
submit Submit a job to run on Kubernetes.
Attempt 2
The pod command has a logs argumen; see help output below:
kbatch pod logs --help
Usage: kbatch pod logs [OPTIONS] POD_NAME
Get the logs for a kbatch pod.
Options:
--kbatch-url TEXT URL to the kbatch server.
--token TEXT File to execute.
--stream / --no-stream Whether to stream the logs
--read-timeout INTEGER Timeout for reading data
--pretty / --no-pretty
--help Show this message and exit.
Now I can list my job names with kbatch job list -o table and then use the output to pick one of the job names "add-coastline-distances-job-q6pbj".
However, when I want to get the logs like this I get a http request error:
kbatch pod logs add-coastline-distances-job-q6pbj
[18:02:21] INFO HTTP Request: GET https://pccompute.westeurope.cloudapp.azure.com/compute/services/kbatch/jobs/logs/add-coastline-distances-job-q6pbj/ "HTTP/1.1 500 Internal Server Error" _client.py:1026
Traceback (most recent call last):
File "/Users/calkoen/mambaforge/envs/jl-full/bin/kbatch", line 8, in <module>
sys.exit(cli())
^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/click/core.py", line 1157, in __call__returnself.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv =self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/click/core.py", line 1688, in invokereturn _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/click/core.py", line 1688, in invokereturn _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/click/core.py", line 1434, in invokereturn ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/click/core.py", line 783, in invokereturn __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/kbatch/cli.py", line 348, in logs
result = _core.logs(pod_name, kbatch_url, token, read_timeout=read_timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/kbatch/_core.py", line 196, in logs
result =next(gen)
^^^^^^^^^
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/kbatch/_core.py", line 233, in _logs
r.raise_for_status()
File "/Users/calkoen/mambaforge/envs/jl-full/lib/python3.11/site-packages/httpx/_models.py", line 761, in raise_for_statusraise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://pccompute.westeurope.cloudapp.azure.com/compute/services/kbatch/jobs/logs/add-coastline-distances-job-q6pbj/'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
The text was updated successfully, but these errors were encountered:
Trying to bring this project back up. I think #79 would have helped you find your problem by showing you the actual error, but kbatch pod logs must take a pod name (i.e. found with kbatch pod list) and add-coastline-distances-job-q6pbj is the name of the job (job pods will have two random bits on the end, e.g. job-q6pbj-abc123, while job names have just one). #81 adds kbatch job logs JOB_NAME so you can get the logs by job name without having to look up the pod for the job yourself.
I would like to access the logs of my (failed) jobs, but I think the docs are slightly outdated and/or I'm doing things wrong.
Attempt 1:
In the docs it's mentioned that you can get the logs by doing
kbatch job logs CONTAINER_ID
"""
With kbatch job logs you can get the logs for a job. Make sure to pass the container id.
'''"
I don't think the current version has a logs argument for the job command. The command I see for job are delete, list, show and submit; see help message below:
Attempt 2
The pod command has a logs argumen; see help output below:
Now I can list my job names with
kbatch job list -o table
and then use the output to pick one of the job names "add-coastline-distances-job-q6pbj".However, when I want to get the logs like this I get a http request error:
The text was updated successfully, but these errors were encountered: