semgrep icon indicating copy to clipboard operation
semgrep copied to clipboard

poor error message when offline

Open ievans opened this issue 3 years ago • 1 comments

Describe the bug When semgrep is run offline with a registry config, the output doesn't clearly explain what's going on:

ine@MacBook-Pro-6 ~/D/r/semgrep (develop)> semgrep --config=auto
Fetching rules from https://semgrep.dev/registry.
[ERROR] Failed to download config from https://semgrep.dev/c/auto: HTTPSConnectionPool(host='semgrep.dev', port=443): Max
retries exceeded with url: /c/auto (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at
0x10f9fa920>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
[ERROR] invalid configuration file found (1 configs were invalid)

Expected behavior A message that clearly explains "semgrep could not connect to semgrep.dev on port 443 (https); is your internet connection working, or check status.semgrep.dev" maybe?

Screenshots If applicable, add screenshots to help explain your problem.

What is the priority of the bug to you?

  • [ ] P0: blocking your adoption of Semgrep or workflow
  • [ ] P1: important to fix or quite annoying
  • [x] P2: regular bug that should get fixed

Environment If not using semgrep.dev: are you running off docker, an official binary, a local build?

Use case What will fixing this bug enable for you?

ievans avatar Sep 13 '22 22:09 ievans

This issue is synced in Linear at https://linear.app/r2c/issue/PA-1883/poor-error-message-when-offline. Note: this link is for r2c use only and is not accessible publicly.

r2c-demo avatar Sep 13 '22 22:09 r2c-demo