Send a test error
$ grim error:test
When a grim command crashes, or one of its steps fails, it sends a report to the registry so that whoever maintains grim sees the failure without you writing it up. That only helps if the report arrives. Run grim error:test on a new machine, behind a new proxy or firewall, or when somebody says "we never saw your error": it sends one harmless report on purpose and tells you what the server answered.
Usage
$ grim error:test # send one report, print the answer
$ GRIM_TELEMETRY=0 grim error:test # refuses: reporting is switched offIt runs from anywhere and needs no project and no login.
Arguments and options
Send a synthetic error to the GRIM registry to verify telemetry
Usage
grim error:testWhat it actually does
- Checks that reporting is on. If it is off, it says so and fails without sending anything.
- Prints what identifies the report.
sourceis alwaysgrim-cli,source_versionis the grim you are running,install_idis this machine's identifier, andauthenticatedsays whether a login token will go along. - Sends one report. A
RuntimeExceptionwith the messageTest error sent from `grim error:test`, marked as manual, to/api/v1/errors/telemetry-reporton grim.grimoiry.com. It waits two seconds at most. - Prints the real answer.
✓ HTTP 200 — test error acceptedand where an administrator finds it, or✗ Telemetry report failedwith the HTTP status, the reason, the start of the response body and a hint. The exit code is non-zero on failure.
A machine that has no install_id yet gets one now, a random UUID saved in ~/.grim/config.json.
What a report carries
The same fields as a real crash report, so this is also the way to see what leaves your machine.
- grim's version, the
install_id, the time and the environment name. - The exception: class, message, file, line and at most thirty lines of stack trace. Your home directory is replaced with
~in every path. - Your OS user name, the computer's name, the operating system and the PHP version.
- The name of the command that failed.
- Your login token as a header, when you are logged in, so the report is tied to your account. Without a login it is anonymous.
No file of yours is read or attached: not grim.json, not any .env.
Switching reporting off
Reporting is on unless you turn it off, per machine, in one of two ways.
| How | Where | Lasts |
|---|---|---|
"telemetry": false |
~/.grim/config.json |
Until you change it back |
GRIM_TELEMETRY=0 |
The environment | That shell or that one command; it wins over the file |
Pitfalls
The refusal names the wrong file
With reporting off the command prints Telemetry is disabled. Enable it via grim.json "telemetry": true. The switch is not read from a project's grim.json. It is the telemetry key in ~/.grim/config.json, or the GRIM_TELEMETRY variable.
No status at all is the network
Reason: No HTTP status received (network failure?) means nothing came back within two seconds: no route, a proxy in the way, or a slow link. Real crash reports are lost the same way, silently. Check that the machine can reach grim.grimoiry.com over HTTPS.
401 and 404 are not yours to fix
Both mean the registry itself is misconfigured or behind: the key it expects is not set, or the endpoint is not deployed there. The hint printed for a 401 is addressed to the registry's administrator. Pass the output on to them.
After it finishes
On success there is nothing more to do. The report carries a manual mark so nobody mistakes it for a real failure, and real failures from this machine will arrive the same way.
Related spells
grim doctor
Check your circle
Check every tool grim expects on this machine, and the project you are standing in, and say what to do about what is missing.
grim auth:login
Log grim in to GitHub
Give grim a GitHub token, from your gh login or a personal access token, and hand the same token to Composer and Docker.
grim auth:whoami
See who grim acts as
Show the GitHub user and the masked token grim holds on this machine.
grim self-update
Update grim itself
Replace the grim phar with the newest release. Projects are not touched.