go.sum access is denied error
Environment:
GoLand 2025.3.1.1
Build #GO-253.29346.379, built on January 14, 2026
Source revision: cd1a4a3e50ac6
Licensed to : deleted
Subscription is active until September 30, 2026.
Runtime version: 21.0.9+1-b1163.86 amd64 (JCEF 137.0.17)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
Every file in the attached ZIP is managed by Perforce and is currently in a read-only state (not checked out for edit). However, when I open the project in GoLand, I encounter an error similar to the following:
GOROOT=C:\Program Files\Go #gosetup GOPATH=C:\Users\deleted\go #gosetup "C:\Program Files\Go\bin\go.exe" list -modfile=E:/ibm\go.mod -m -json -mod=mod all #gosetup
go: updating go.sum: open E:/ibm\go.sum: Access is denied.
If I check out go.sum before opening the project, the error disappears. Interestingly, even after the command runs, a diff shows that the file content has not changed at all. I would like to know why the go list command throws an "Access is denied" error due to the read-only status, even when it doesn't actually end up modifying the content of go.sum.
The upload ID is 2026_01_28_K2T8avUkUYVjd4yELcGBTW.
请先登录再写评论。
Hi Jovial92nc ! Thank you for your question. I think this sounds expected - we run
go listwith-mod=modto correctly build the list of dependencies and index them. In this mod, the command needs the correct level of access to the file to modify it if necessary. It might not change anything if the indexes are built correctly already, but the error similar to what you observe might still come up.Does it answer your question?
I understand your explanation, but I still don’t find it logical that I have to manually check out
go.sumevery time I open the project.For your reference, the project I uploaded with Upload ID: 2026_01_28_v4D1F7HFv6fLZq1Gm7bSpz does not encounter any "access denied" errors.
Hi Jovial92nc ! May I ask you to try moving the project to the C mount? It looks like you have Go installed there, so this might potentially make a difference in how the project is launched. Another question: is there a reason for having the project in a read-only state? For the IDE to process everything correctly, we require permissions to modify the project files. We need to index them and build a dependency map for autocomplete and inspections to work correctly. Having everything ‘locked’ might prevent the IDE's correct flow and cause issues when working with the project…
Hi Vadym,
The reason the files are read-only is that the project is managed via Perforce, which keeps files in a read-only state by default unless they are checked out. To avoid the inconvenience of manual check-outs before editing, I have unchecked the option 'Ask to unlock files set to read-only if you attempt to edit them' under Settings -> Version Control -> Confirmation. This allows the files to be automatically checked out when edited, enabling a seamless workflow.
Is it difficult to identify why there is a discrepancy between the two projects I uploaded by reviewing the logs or other diagnostic data?
Please let me know if you need any further information.
Hi Jovial92nc ! Thank you for elaborating. I'm afraid it is difficult indeed - I've been testing this and discussing the case with the team last week. I was able to reproduce a very similar issue, though it is not a 100% match. For me, the following error comes up:
go: updating go.mod: open /Users/***/Downloads/test (1)/go.mod: permission deniedIt is likely that the issue I see and what you report (problem with go.sum) have the same root cause. The one I observe has a clear explanation: when we launch the IDE, we check the dependencies in the go.mod and try to download the latest versions of them, which can trigger the error if the files are in read-only mode. As for the problem with go.sum, I'd suggest trying two things:
go get -v -u alland fails due to an incorrect level of access to the necessary files. You can open the project in the IDE and run this command in the console to confirm whether this is the case on your end as well. If you receive the same error, then we've got the answer.I hope this helps!
Hi Vadym,
As expected, running go get -v -u all triggers an 'Access is denied' error for go.mod.
After manually checking out go.mod to remove the read-only restriction and rerunning the command, I get a similar error for go.sum: go: updating go.sum: open ~~\go.sum: Access is denied.
Not surprisingly, once I check out go.sum as well, the command runs without any issues.
Hi Jovial92nc ! Understood. It seems to be as we suspected - the TEST project uses more external packages, and the error you see is expected if one of those packages is outdated: GoLand tries to update it, but the operation fails because go.mod and go.sum are in read-only mode. Hope this answers your question.
Please let me know if there is anything else I can assist you with at the moment, and I'll be at your service.