Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sheet-upload currently broken #24

Open
dholbach opened this issue Jan 7, 2025 · 2 comments
Open

sheet-upload currently broken #24

dholbach opened this issue Jan 7, 2025 · 2 comments

Comments

@dholbach
Copy link
Member

dholbach commented Jan 7, 2025

https://github.com/fluxcd/stats/actions/runs/12642421652/job/35226683002

Run kingdonb/csv-to-google-spreadsheet@1.0.2
/usr/bin/docker run --name a8451505a854840d7a7dc13fc6dce125a_55ccc8 --label 84423a --workdir /github/workspace --rm -e "INPUT_CSV_PATH" -e "INPUT_SPREADSHEET_ID" -e "INPUT_WORKSHEET" -e "INPUT_APPEND_CONTENT" -e "INPUT_GOOGLE_SERVICE_ACCOUNT_EMAIL" -e "INPUT_GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/stats/stats":"/github/workspace" 84423a:8451505a854840d7a7dc13fc6dce125a  "pageviews.csv" "***" "0" "true" "***" "***
"
Traceback (most recent call last):
  File "/importer.py", line 57, in <module>
    ws.update(start_from, list_of_rows)
  File "/usr/local/lib/python3.8/dist-packages/gspread/utils.py", line 591, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/gspread/models.py", line 1276, in update
    response = self.spreadsheet.values_update(
  File "/usr/local/lib/python3.8/dist-packages/gspread/models.py", line 265, in values_update
    r = self.client.request('put', url, params=params, json=body)
  File "/usr/local/lib/python3.8/dist-packages/gspread/client.py", line 76, in request
    raise APIError(response)
gspread.exceptions.APIError: {'code': 403, 'message': 'The caller does not have permission', 'status': 'PERMISSION_DENIED'}

Could it be that the action is being run using my user or something?

cc @kingdonb

@kingdonb
Copy link
Member

kingdonb commented Jan 7, 2025

Thank you, looks like a token has expired or been removed. I think there are a few workflows still in your name, it might be based on who issued the PAT! I will take a look and see if I can get this running again, with a bot username. Thanks for the alert.

kingdonb pushed a commit to kingdonb/stats that referenced this issue Jan 7, 2025
See fluxcd#24

Signed-off-by: Kingdon B <yebyen@gmail.com>
@kingdonb
Copy link
Member

kingdonb commented Jan 7, 2025

It looks like the issue started around June 5. I'm going to guess that Google Sheets access token was issued under the Weaveworks org, and that it was never replaced with a Google Sheets access token belonging to someone's active Google account. I don't think this has anything to do with your user (but you might be being notified for some other reason)

I don't think I'll have time to look at it today. If it has been broken for 7 months and nobody noticed it, I think we can disable it.

As far as I can tell, we are still getting monthly statistics, and I could make an argument about how they aren't very granular, and the top-10-ness makes those statistics not very useful, compared to the daily view, which can actually be used to detect spikes (vs. long-term trends like those that skew data over a period of a month or longer)

But as long as there's nobody whose job it is to collate these statistics and make use of them, it seems like it isn't really a good use of time collecting them. Moreover this repo has grown to almost 600MB - it's time to rethink the way we aggregate this data.

I'll rather restart this discussion when we can use our own page tracking technology to collect statistics, or our own log readers to count the number of visitors without javascript or cookies - I think this is still impossible due to having to go through Netlify as an interface to the data. They are actually very restrictive in what they allow us to know about our visitors.

Anyway, in the mean time, I've submitted #25 which will stop the daily squawking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants