R "R CMD check" returns ERROR in CI
R CMD check ran the package checks and at least one returned ERROR, so the overall status is "1 ERROR" and the job fails. The failing check (examples, tests, or vignettes) is named in the log just above the summary.
What this error means
The check job ends with "Status: 1 ERROR" (sometimes plus warnings or notes). On GitHub Actions the r-lib/actions check-r-package step then exits non-zero.
* checking examples ... ERROR
Running examples in 'mypkg-Ex.R' failed
The error most likely occurred in:
> ### Name: do_thing
Error in do_thing(NULL) : argument "x" is missing, with no default
Status: 1 ERROR, 1 WARNING, 2 NOTEsCommon causes
An example, test, or vignette errored
A runnable example, a testthat test, or a vignette chunk threw an error during the check, which R CMD check reports as a hard ERROR.
A check stricter in CI than locally
CI runs with --as-cran or error_on = "error", surfacing failures that an interactive local build skipped.
How to fix it
Read the failing section and fix the code
- Find the "... ERROR" line and the section it names (examples, tests, vignettes).
- Reproduce locally with the same check level.
- Fix the failing example or test, then re-run the check.
Rscript -e 'rcmdcheck::rcmdcheck(args="--no-manual", error_on="error")'Match the CI check arguments locally
Run the same arguments the workflow uses so the failure reproduces before you push.
R CMD build .
R CMD check mypkg_*.tar.gz --as-cranHow to prevent it
- Run
R CMD check --as-cranlocally before pushing. - Keep examples and vignettes runnable with valid inputs.
- Treat check warnings as failures so they do not become errors later.