How to fix `Error applying workspace layer for job`

If your project is utilizing Workspaces, but you run into trouble when attaching the workspace later on in the workflow, you may have exceeded your memory limit.

Your error may look similar to below.

"Error applying workspace layer for job 5cb8xxxx-xxxx-4499-9xxxx-1aaa2943xxxx: Error extracting tarball /tmp/workspace-layer-5cb8xxxx-xxxx-4499-9xxx-1aaa2943xxxxx04313xx: signal: killed"

In this particular error, we can clearly see the process was gracefully killed with the `signal: killed` message. This is a guaranteed message that your container has exceeded its memory resource limits. Your error may or may not contain this message but have failed anyway in a similar way.

 You can follow the instructions in this article to record the max memory usage of your job.

Options to resolve:

  1. Reduce tarball size. The larger the tarball, the more memory will be utilized while decompressing. If your workspace's physical size is near or over your container's memory limit (4gb by default), you can exceed it easily, especially if you have one or more databases also running.
  2. Contact support to inquire about upgrading your container's resource limits via the `resource_class` key in your config.yml. This option is already available to those on the "Performance plan"