Browsing Output Logs

This tutorial will describe how to explore Airbyte Workspace folders.
This is useful if you need to browse the docker volumes where extra output files of Airbyte server and workers are stored since they may not be accessible through the UI.

When running a Sync in Airbyte, you have the option to look at the logs in the UI as shown next.

In the screenshot below, you can notice the highlighted blue boxes are showing the id numbers that were used for the selected "Attempt" for this sync job.
In this case, the job was running in /tmp/workspace/9/2/ folder since the tab of the third attempt is being selected in the UI (first attempt would be /tmp/workspace/9/0/).
The highlighted button in the red circle on the right would allow you to download the logs.log file. However, there are actually more files being recorded in the same workspace folder... Thus, we might want to dive deeper to explore these folders and gain a better understanding of what is being run by Airbyte.

Scrolling down a bit more, we can also read the different docker commands being used internally are starting with:
docker run --rm -i -v airbyte_workspace:/data -v /tmp/airbyte_local:/local -w /data/9/2 --network host ...
From there, we can observe that Airbyte is calling the -v option to use a docker named volume called airbyte_workspace that is mounted in the container at the location /data.
Following Docker Volume documentation, we can inspect and manipulate persisted configuration data in these volumes.

For example, we can run any docker container/image to browse the content of this named volume by mounting it similarly, let's use the busybox image.
docker run -it --rm --volume airbyte_workspace:/data busybox
This will drop you into an sh shell inside the docker container to allow you to do what you want inside a BusyBox system from which we can browse the filesystem and accessing to log files:
ls /data/9/2/
Example Output:
catalog.json normalize tap_config.json
logs.log singer_rendered_catalog.json target_config.json

Or, if you don't want to transfer to a shell prompt inside the docker image, you can simply run Shell commands using docker commands as a proxy like this:
docker run -it --rm --volume airbyte_workspace:/data busybox ls /data/9/2
Example Output:
catalog.json singer_rendered_catalog.json
logs.log tap_config.json
normalize target_config.json

For example, it is often useful to inspect the content of the catalog file. You could do so by running a cat command:
docker run -it --rm --volume airbyte_workspace:/data busybox cat /data/9/2/catalog.json
Example Output:

Or if you want to copy it out from the docker image onto your host machine:
docker cp airbyte-server:/tmp/workspace/9/2/catalog.json .
cat catalog.json

If you are running on Kubernetes, use the following commands instead to browsing and copy the files to your local.
To browse, identify the pod you are interested in and exec into it. You will be presented with a terminal that will accept normal linux commands e.g ls.
kubectl exec -it <pod name> -n <namespace pod is in> -c main bash
kubectl exec -it destination-bigquery-worker-3607-0-chlle -n jobs -c main bash
[email protected]:/config# ls
FINISHED_UPLOADING destination_catalog.json destination_config.json
To copy the file on to your local in order to preserve it's contents:
kubectl cp <namespace pods are in>/<normalisation-pod-name>:/config/destination_catalog.json ./catalog.json
kubectl cp jobs/normalization-worker-3605-0-sxtox:/config/destination_catalog.json ./catalog.json
cat ./catalog.json

If you setup a pipeline using one of the local File based destinations (CSV or JSON), Airbyte is writing the resulting files containing the data in the special /local/ directory in the container. By default, this volume is mounted from /tmp/airbyte_local on the host machine. So you need to navigate to this local folder on the filesystem of the machine running the Airbyte deployment to retrieve the local data files.
Or, you can also run through docker commands as proxy:
#!/usr/bin/env bash
echo "In the container:"
docker run -it --rm -v /tmp/airbyte_local:/local busybox find /local
echo ""
echo "On the host:"
find /tmp/airbyte_local
Example Output:
In the container:
On the host:

Note that Docker for Mac is not a real Docker host, now it actually runs a virtual machine behind the scenes and hides it from you to make things "simpler".
Here are some related links as references on accessing Docker Volumes:
From these discussions, we've been using on macOS either:
  1. 1.
    any docker container/image to browse the virtual filesystem by mounting the volume in order to access them, for example with busybox
  2. 2.
    or extract files from the volume by copying them onto the host with Docker cp
However, as a side remark on Linux, accessing to named Docker Volume can be easier since you simply need to:
docker volume inspect <volume_name>
Then look at the Mountpoint value, this is where the volume is actually stored in the host filesystem and you can directly retrieve files directly from that folder.
Copy link
On this page
Exploring the Logs folders
Identifying Workspace IDs
Understanding the Docker run commands
Opening a Unix shell prompt to browse the Docker volume
Browsing from the host shell
Reading the content of the catalog.json file
Extract catalog.json file from docker volume
Browsing on Kubernetes
CSV or JSON local Destinations: Check local data folder
Notes about running on macOS vs Linux