google / clusterfuzz

Scalable fuzzing infrastructure.
https://google.github.io/clusterfuzz
Apache License 2.0
5.26k stars 551 forks source link

Fix update task errors due to source files lacking write permissions #4074

Closed vitorguidi closed 1 month ago

vitorguidi commented 1 month ago

Motivation

This error would show up, after dependencies upgrade, during upgrade task:

Traceback (most recent call last):
  File "/mnt/scratch0/clusterfuzz/src/clusterfuzz/_internal/bot/tasks/update_task.py", line 256, in update_source_code
TypeError: chmod: path should be string, bytes, os.PathLike or integer, not NoneType

This happened before in #3249 , and the root cause is that the protobuf wheel would containe files without the write bit set, thus failing to overwrite from new source zips. This PR attempts to fix it

Testing strategy

Ran the command

butler run run_locally --config-dir=$HOME/projects/clusterfuzz-config/configs/internal

without the change, and verified the issue happened during a local update task. After the change, the error did not manifest again.

This PR belongs to this initiative