KB: Cannot save project due to Git Error with status code 471
Solution Details
Why this happensThe git server of A365 workspace has protection against misuse: it does not allow binary files larger than 256 MB of the following types:
- zip
- 7z
- rar
Pushing those files to repositories can lead to a significant slowdown in both client-side and server-side processing of customer data, up to denial of service.
Once the user tries to save such a file to the server from Altium designer, the save operation will be rejected by the server with the following error code:
In that case, the user will have to take this file out of version control in their local git repository.
Prerequisites
Users need to download and install git SCM: https://git-scm.com/download/win . The “standalone installer” is recommended, most likely it will be the “64-bit” installer, but it depends on the operating system (here is how to check this: link).
Commands to take the file out of version control
- Determine the location of the project git repository on disk. Right click on the project in the Projects panel, then click Explore:
- Windows explorer will open. Copy the full path to the folder:
- Start “Git Bash” utility:
- Change the current directory to the one you copied from Windows explorer:
cd "C:\Users\Public\Documents\Altium\Sample - Kame_FMU"
- Execute the following command to find out which files violate server restrictions for size:
- git rev-list --objects "origin/master..master" | git cat-file $'--batch-check=%(objectname)\t%(objecttype)\t%(objectsize)\t%(rest)' | gawk -F '\t' -v maxbytes="256000000" '$3 > maxbytes' | cut -f 4- | grep -E "\.(zip|rar|7z)"
The command will output the file (or the list of files) that cannot be pushed to the server. In our example, the file is “bad.zip”:
- Execute the following command to start editing the repository:
git reset --soft $(git merge-base origin/master HEAD)
- Take the file(s) you found on step 6 out of version control using the git reset command for each file. In our example there is only one such file, so we’re executing this command once:
git reset bad.zip - Return to Altium designer and refresh the project from version control:
- Then click Save to Server as usual. Make sure you don’t select the restricted files again:
- The project should be saved without errors.