# Failed to write credentials

**URL:** <https://community.sonarsource.com/t/failed-to-write-credentials/135113>\
**Category:** Visual Studio\
**Created:** [February 13, 2025, 10:20am UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113 "2025-02-13T10:20:33Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![RybaMaciej](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RybaMaciej](https://community.sonarsource.com/u/RybaMaciej)\
**Post date:** [February 13, 2025, 10:20am UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/1 "2025-02-13T10:20:34Z")

</div>

- Operating system: Windows 11
- Visual Studio version: 2022
- SonarQube for Visual Studio plugin version: 8.11.0.11944
- Programming language you’re coding in: C++
- Is connected mode used: SonarQube Cloud

I am constantly getting the **Failed to write credentials, Win32ErrorCode: 1312**. I tried all the solutions on the internet. I don’t have a problem connecting using Visual Studio Code and its SonarLint extension. Might it be caused by internal company policies or other constraints? For some reason, the Visual Studio is always started as an Admin. I am not using a remote desktop, etc.  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/3/e/3e564db564795bb1cbfd27f8bd584242de0315c9.png)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 13, 2025, 2:06pm UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/2 "2025-02-13T14:06:15Z")

</div>

Hi,

Can you copy/paste the _text_ of a [verbose log](https://docs.sonarsource.com/sonarqube-for-ide/visual-studio/troubleshooting/), please?

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![RybaMaciej](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RybaMaciej](https://community.sonarsource.com/u/RybaMaciej)\
**Post date:** [February 13, 2025, 2:20pm UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/3 "2025-02-13T14:20:32Z")

</div>

Hi,

This is it:

```auto
[ThreadId 1] Initializing the telemetry package...
[ThreadId 1] Finished initializing the telemetry package...
[ThreadId 72] Initializing the daemon package...
[ThreadId 72] [Connection Migration] Start migrating connections from existing bindings
[ThreadId 72] [Connection Migration] End migrating connections from existing bindings
[DEBUG] [ThreadId 1] [ConnectedMode/GitMonitor] Monitoring git repo. Root path: C:\Users\MR3295\Projects\SA_Platform
[ThreadId 30] [SLCoreHandler] Creating SLCore instance
[ThreadId 30] [SLCoreHandler] Starting SLCore instance
[ThreadId 30] Loaded settings from "C:\Users\MR3295\AppData\Roaming\SonarLint for Visual Studio\settings.json".
[ThreadId 1] Current VS version:
    Visual Studio Professional 2022
    17.8.34322.80
    17.8.2
[ThreadId 30] [NodeJSLocator] Checking environment variable SONAR_NODEJS_PATH
[ThreadId 30] [NodeJsLocator] Environment variable is not set
[ThreadId 30] Finished initializing the daemon package.
[DEBUG] [ThreadId 6] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Error while starting port: 64120, Address already in use: bind
[DEBUG] [ThreadId 6] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Error while starting port: 64121, Address already in use: bind
[DEBUG] [ThreadId 6] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Started embedded server on port 64122
[DEBUG] [ThreadId 53] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Restoring previous local-only issue database from C:\Users\MR3295\AppData\Local\SLVS_SLOOP\storageRoot\local_only_issue_backup.tar.gz
[DEBUG] [ThreadId 7] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Starting local-only issue database from C:\Users\MR3295\AppData\Local\SLVS_SLOOP\workDir\xodus-local-only-issue-store2357734951032642859
[ThreadId 6] [SLCore] [jetbrains.exodus.io.FileDataWriter > SonarLint Server RPC sequential executor] Can't open directory channel. Log directory fsync won't be performed.
[DEBUG] [ThreadId 28] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Using default trace sample rate: 0.01
[DEBUG] [ThreadId 28] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Monitoring is disabled by feature flag.
[ThreadId 1] Initializing the SonarQube for Visual Studio package...
[ThreadId 1] Finishing initializing the SonarQube for Visual Studio package
[DEBUG] [ThreadId 1] [SharedBindingConfigFileProvider] Unable to read shared config file: Could not find file 'C:\Users\MR3295\Projects\SA_Platform\.sonarlint\SA_Platform.json'.
[DEBUG] [ThreadId 30] [SLCore] [sonarlint > Connection Suggestion Provider] Computing connection suggestions
[DEBUG] [ThreadId 30] [SLCore] [sonarlint > SonarLint Server RPC sequential executor] Synchronizing new configuration scopes: [SA_Platform]
[ThreadId 55] Updated analysis readiness: True
[DEBUG] [ThreadId 28] [SLCore] [sonarlint > Connection Suggestion Provider] Extracting scanner properties from file:///C:/Users/MR3295/Projects/SA_Platform/.sonarlint/bcmapcnv.json
[DEBUG] [ThreadId 19] [SLCore] [sonarlint > Connection Suggestion Provider] Found a SonarLint configuration file with a clue
[DEBUG] [ThreadId 19] [SLCore] [sonarlint > Connection Suggestion Provider] Found 1 binding clue from SonarLint configuration files
[DEBUG] [ThreadId 19] [SLCore] [sonarlint > Connection Suggestion Provider] Found a SonarCloud binding clue
[DEBUG] [ThreadId 19] [SLCore] [sonarlint > Connection Suggestion Provider] Found 1 connection suggestion
[DEBUG] [ThreadId 24] [SLCore] [sonarlint > SonarLint Server RPC request executor] GET 200 https://sonarcloud.io/api/system/status | response time=633ms
[DEBUG] [ThreadId 24] [SLCore] [sonarlint > SonarLint Server RPC request executor] Downloaded server infos in 633ms
[DEBUG] [ThreadId 11] [SLCore] [sonarlint > SonarLint Server RPC request executor] GET 200 https://sonarcloud.io/api/authentication/validate?format=json | response time=246ms
[DEBUG] [ThreadId 14] [SLCore] [sonarlint > SonarLint Server RPC request executor] Load user organizations...
[DEBUG] [ThreadId 30] [SLCore] [sonarlint > SonarLint Server RPC request executor] GET 200 https://sonarcloud.io/api/organizations/search.protobuf?member=true&ps=500&p=1 | response time=2929ms
[DEBUG] [ThreadId 67] [SLCore] [sonarlint > SonarLint Server RPC request executor] Page downloaded in 2961ms
[DEBUG] [ThreadId 67] [SLCore] [sonarlint > SonarLint Server RPC request executor] Creating index for 2 organizations
[DEBUG] [ThreadId 58] [SLCore] [sonarlint > SonarLint Server RPC request executor] GET 200 https://sonarcloud.io/api/system/status | response time=258ms
[DEBUG] [ThreadId 58] [SLCore] [sonarlint > SonarLint Server RPC request executor] Downloaded server infos in 259ms
[DEBUG] [ThreadId 5] [SLCore] [sonarlint > SonarLint Server RPC request executor] GET 200 https://sonarcloud.io/api/authentication/validate?format=json | response time=238ms
[DEBUG] [ThreadId 24] [SLCore] [sonarlint > SonarLint Server RPC request executor] GET 200 https://sonarcloud.io/api/organizations/search.protobuf?organizations=hesc1&ps=500&p=1 | response time=1691ms
[DEBUG] [ThreadId 24] [SLCore] [sonarlint > SonarLint Server RPC request executor] Page downloaded in 1691ms
[ThreadId 1] Failed to write credentials, Win32ErrorCode: 1312. See https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes for more information.
[ThreadId 1] Failed adding server connection: Failed to write credentials
[DEBUG] [ThreadId 1] [SharedBindingConfigFileProvider] Unable to read shared config file: Could not find file 'C:\Users\MR3295\Projects\SA_Platform\.sonarlint\SA_Platform.json'.

```

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 13, 2025, 3:08pm UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/5 "2025-02-13T15:08:40Z")

</div>

Hi,

Thanks for the log.

Can you try this?

> [@Unable to configure SonarLint in Connected Mode](https://community.sonarsource.com/t/unable-to-configure-sonarlint-in-connected-mode/110149/5):
>
> Hi Nitin, Welcome to the community. To make sure the you have the right permission could you please ensure that “Local Security Policy → Local Policies → Security Options → Network access: Do not allow storage of passwords and credentials for network authentication” is set to disabled

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![RybaMaciej](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RybaMaciej](https://community.sonarsource.com/u/RybaMaciej)\
**Post date:** [February 13, 2025, 3:27pm UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/6 "2025-02-13T15:27:20Z")

</div>

I already checked this option, this is disabled:  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/9/e/9e59e657937858c902f598e6675afc9a9590189d.png)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 13, 2025, 3:42pm UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/8 "2025-02-13T15:42:54Z")

</div>

Hi,

Thanks for checking. I’ve flagged this for the team.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![georgii.borovinskikh](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@georgii.borovinskikh](https://community.sonarsource.com/u/georgii.borovinskikh)\
**Post date:** [February 17, 2025, 10:07am UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/10 "2025-02-17T10:07:19Z")

</div>

Hi @RybaMaciej

Unfortunately, I am not able to reproduce this problem locally running under Admin privileges. Still, could you try launching your VS without Admin privileges and repeating the process?

If that doesn’t work, would you be open to running a custom build with some additional logging? As things stand now, there’s not enough information for me to understand what’s going on

JFYI: you’re not having similar problems with SQ for VSCode due to it storing credentials in a different way

---

<div class="post-metadata">

**Author:** ![RybaMaciej](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RybaMaciej](https://community.sonarsource.com/u/RybaMaciej)\
**Post date:** [February 17, 2025, 1:28pm UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/11 "2025-02-17T13:28:32Z")

</div>

Hi,

I think it could be possible to run a custom build if it is approved by the security team in my company. Anyway, could you please guide me through the installation process?

---

<div class="post-metadata">

**Author:** ![georgii.borovinskikh](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@georgii.borovinskikh](https://community.sonarsource.com/u/georgii.borovinskikh)\
**Post date:** [February 17, 2025, 3:36pm UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/12 "2025-02-17T15:36:09Z")

</div>

Hi

We would need some time to prepare a build, as it is not something that is already implemented.

Have you tried to run VS without Admin privileges? Did it work or did you encounter the same problem?

---

<div class="post-metadata">

**Author:** ![RybaMaciej](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RybaMaciej](https://community.sonarsource.com/u/RybaMaciej)\
**Post date:** [February 18, 2025, 7:05am UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/13 "2025-02-18T07:05:38Z")

</div>

Hi,  
Sorry, didn’t mention it. Unfortunately, due to some company policies, I am not able to run VS without Admin. I tried all possibilities and it always starts as an Admin.

---

<div class="post-metadata">

**Author:** ![georgii.borovinskikh](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@georgii.borovinskikh](https://community.sonarsource.com/u/georgii.borovinskikh)\
**Post date:** [February 19, 2025, 2:18pm UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/14 "2025-02-19T14:18:47Z")

</div>

Hi, this is a custom build with extra logging around User Identity [Cirrus CI](https://cirrus-ci.com/task/6289804234588160)  
You should be able to download the `.vsix` from the `binaries` tab.

You can share the full log in a direct message with me once you try to add a server connection again

Also, could you try adding `Generic Credentials` using Windows’ Credential Manger? It doesn’t matter what the actual value is, just check if you’re able to add something

---

<div class="post-metadata">

**Author:** ![RybaMaciej](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@RybaMaciej](https://community.sonarsource.com/u/RybaMaciej)\
**Post date:** [February 20, 2025, 8:40am UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/15 "2025-02-20T08:40:05Z")

</div>

Hi,  
Can I send you extended logs via the private message?

I can add entries in the Credential Manager successfully.

---

<div class="post-metadata">

**Author:** ![georgii.borovinskikh](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@georgii.borovinskikh](https://community.sonarsource.com/u/georgii.borovinskikh)\
**Post date:** [February 20, 2025, 8:55am UTC](https://community.sonarsource.com/t/failed-to-write-credentials/135113/16 "2025-02-20T08:55:32Z")

</div>

Hi, I’ve sent you a DM
