TechBuzzPro

Debug Missing Screenshots in Argos CI Build

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

When Argos CI reports that screenshots are missing from your build, it usually means the test runner finished but the screenshots never reached Argos, or they were uploaded under a different build ID. This guide walks you through the most common causes and fixes, from checking your CI environment variables to verifying the Argos CLI output. You'll need access to your CI pipeline configuration and the Argos project dashboard.

What You'll Need

  • Access to your CI pipeline configuration (e.g., GitHub Actions, GitLab CI, CircleCI)
  • The Argos CLI installed in your project (usually via npm or yarn)
  • Your Argos token and project slug
  • Ability to view CI logs (or run the build locally for testing)

Step-by-Step

  1. Confirm the screenshots are actually generated. Before looking at Argos, ensure your test runner (Playwright, Cypress, etc.) is saving screenshots to the expected directory. Check your test configuration for the outputDir or screenshotsFolder setting. Run the tests locally and verify the files exist.
  2. Check the Argos CLI command in your CI. Look at the exact command you're using to upload screenshots. It should be something like npx argos upload . Make sure the directory path is correct relative to the CI workspace. A common mistake is using a relative path that doesn't exist in the CI environment.
  3. Verify the Argos token is set. Argos requires an ARGOS_TOKEN environment variable. In your CI settings, ensure it's defined and available to the job that runs the upload. If the token is missing or incorrect, Argos will reject the upload, and you may see no screenshots.
  4. Check the build ID. Argos groups screenshots by a build ID, which is automatically derived from the CI environment (e.g., commit SHA, branch, build number). If your CI provider isn't detected, Argos may generate a random build ID each time, causing screenshots to appear under different builds. To force a consistent ID, set the ARGOS_BUILD_ID environment variable to something unique per build, like the commit SHA.
  5. Run the upload command locally with the same parameters. To isolate the issue, run the exact Argos command locally with the same directory and token. If it works locally, the problem is CI-specific. If it fails, you'll see an error message that points to the cause (e.g., invalid token, empty directory).
  6. Inspect the CI logs for the upload step. Look for output from the Argos CLI. It should print something like "Uploading N screenshots" and a URL to the build. If it says "No screenshots found", the directory is empty or the path is wrong. If it says "Unauthorized", the token is invalid.
  7. Check the Argos dashboard for the build. After a successful upload, you should see a new build in the Argos dashboard. If the build appears but screenshots are missing, click on the build to see if there's an error message like "Failed to process image". Sometimes the screenshot format is unsupported (e.g., WebP) or the file is corrupted.
  8. Ensure the upload step runs after the test step. In your CI pipeline, the Argos upload must be a separate step that runs after tests complete. If the upload runs in parallel or before tests finish, it may find no screenshots yet. Use a dependency or needs clause to sequence them.
  9. Verify the CI provider is supported. Argos auto-detects common CI providers (GitHub Actions, GitLab, CircleCI, etc.). If you're using a less common provider, the detection may fail. In that case, set the ARGOS_CI_PROVIDER environment variable to your provider name (e.g., github_actions, gitlab, circleci).
  10. Check for network or proxy issues. In some corporate CI environments, outbound HTTPS requests are blocked or require a proxy. Ensure the CI runner can reach https://api.argos-ci.com. If not, configure the proxy in your CI environment.

Common Mistakes

  • Using a relative path that doesn't exist. The upload command is executed from the CI workspace root, but your screenshots might be in a subdirectory. Always use a path relative to the workspace, or use an absolute path.
  • Forgetting to set the token as a secret. If you put the token directly in the pipeline file, it may be masked, but if it's not set at all, the upload fails silently.
  • Uploading before tests finish. This is common in parallel pipelines. Ensure the upload job depends on the test job.
  • Ignoring the CLI output. The Argos CLI gives clear messages. Many users skip reading the logs and miss the "No screenshots found" warning.
  • Not cleaning up old screenshots. If your test runner doesn't clear the output directory between runs, you might upload stale screenshots, but that's not the same as missing ones—though it can confuse the build comparison.

Tips

  • Use a unique build ID per commit. Set ARGOS_BUILD_ID to $GITHUB_SHA (GitHub Actions) or $CI_COMMIT_SHA (GitLab) to ensure each commit gets its own build.
  • Add a debug flag. Run the upload with DEBUG=argos* to get verbose logs. This can reveal exactly what the CLI is doing.
  • Create a minimal reproduction. If you're stuck, create a small test project that generates one screenshot and uploads it. This isolates the issue from your main codebase.
  • Keep the Argos CLI up to date. Older versions may have bugs with newer CI providers. Update to the latest version regularly.
  • Use the Argos GitHub Action. If you're on GitHub, the official argos-ci/argos-action simplifies the process and handles build ID detection automatically.

Troubleshooting

If the upload succeeds but no screenshots appear in Argos: Check the build in the dashboard. If it says "Build failed", click on it to see the error. Often it's an image processing issue—ensure your screenshots are PNG or JPEG. If they are WebP, convert them.

If the CLI says "No screenshots found": Double-check the directory path. Run ls -la in CI to confirm the files are there. Also, ensure the test runner actually saved screenshots—some frameworks only save on failure unless configured otherwise.

If you see an authentication error: Verify the token is correct and has not expired. Generate a new token in the Argos dashboard and update your CI secret.

If the build ID changes every run: This happens when the CI provider isn't detected. Set ARGOS_CI_PROVIDER manually. For example, for GitHub Actions, set it to github_actions.

If the upload step times out: Large numbers of screenshots can take time. Increase the timeout for that step, or split the upload into multiple batches.

Frequently Asked Questions

Why does Argos not detect my CI provider?

Argos relies on environment variables that are standard in major CI systems. If you're using a custom or less common setup, those variables may not be present. Set ARGOS_CI_PROVIDER manually to your provider's slug.

Can I upload screenshots from a local machine?

Yes, you can run the Argos CLI locally. You'll need to set ARGOS_TOKEN and optionally ARGOS_BUILD_ID to a unique value. This is useful for testing.

What if my screenshots are in multiple directories?

You can run the upload command multiple times with different directories, or you can combine them into one directory before uploading. Argos supports uploading multiple times to the same build.

Do I need to install the Argos CLI separately?

No, you can use npx @argos-ci/cli to run it without installing. However, pinning a version in your package.json is recommended for reproducibility.

Why do my screenshots appear under a different build than expected?

This is usually due to a missing or inconsistent build ID. Ensure ARGOS_BUILD_ID is set to a value that is unique per commit, like the commit SHA.

Can I upload screenshots from a Docker container?

Yes, as long as the container has network access to Argos and the token is available as an environment variable. The CLI works the same way.