GoogleCloudPlatform / GoogleCloudPlatform/gsutil

Failed to find CHECKSUM in ReportMetrics

Open
#1,612 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

When usage reporting is enabled, `ReportMetrics` in `gslib/metrics.py` will be called with creating a subprocess of python. It's using `-c` to executing the [script](https://github.com/GoogleCloudPlatform/gsutil/blob/50b336938a1aeb7679996358826299787a1c8645/gslib/metrics.py#L783).

This conflits with the [assumption](https://github.com/GoogleCloudPlatform/gsutil/blob/c388ff0f99320ebab877d14afe458e10b8bcddd8/gslib/__init__.py#L61) that `gsutil is the running script` in gslib and GSUTIL_DIR will be empty.

This may be the same issue reported in https://github.com/GoogleCloudPlatform/gsutil/issues/455#issuecomment-344457787

Contributor guide

Open the contributing guide

Research direction

Start by reading ReportMetrics in gslib/metrics.py and the GSUTIL_DIR assumption in gslib/__init__.py, then trace the subprocess invocation using Python’s -c option. Reproduce the usage-reporting path and verify that CHECKSUM is found correctly when the script is launched this way.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.