question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SWA Login: libsecret-1.so.0: cannot open shared object file: No such file or directory

See original GitHub issue

Describe the bug Receiving error when running a swa login command on linux from within docker image / dev container.

To Reproduce Steps to reproduce the behavior:

  1. Run az login to initialize azure credentials
  2. Run az account set -s {subscriptionId} to set default subscription
  3. Run swa login --subscription-id {subscriptionId} --resource-group {resourceGroupName} --tenant-id {tenantId} --app-name {appName}

Expected behavior SWA login command should succeed without error to allow for subsequent commands to deploy.

Actual behavior Receive the following error Failed to setup project: libsecret-1.so.0: cannot open shared object file: No such file or directory

Screenshots image

Desktop (please complete the following information):

  • OS: Linux, vscode dev container mcr.microsoft.com/vscode/devcontainers/base:0-bullseye

Additional context Works as expected on Windows

When passing in the --no-use-keychain it runs me through a fresh azure login and works as expected.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wbrezacommented, Jul 13, 2022

@manekinekko We ended up using option 3 from your list where we manually grab the deployment token and pass it through to the swa deploy command instead of making a call to swa login. All is now working as expected.

1reaction
manekinekkocommented, Jun 30, 2022

A little bit of context

When using swa login, the flag --use-keychain is enabled by default because we encrypt and store your credentials in your native Keychain (aka. the built-in password manager of your operating system). This operation depends on a system dependency called libsecret. If your system doesn’t come bundled libsecret (most systems do provide it by default), you will then encounter the error in the OP.

Why do I need to swa login?

In order to be able to automatically deploy your app to your Azure Static Web Apps instance, we need a Deployment Token. To automate that operation and avoid asking the users to manually find that deployment token, which can take several steps, we provide a built-in and convenient option to do that: swa login.

How to avoid this issue?

In order to avoid this issue, you have a few options:

  1. Manually install libsecret by adding it to your Docker image or your system (recommended)
  2. Disable Keychain access using --no-use-keychain. Doing so won’t store and remember your credentials anymore, and you will have to interactively log in again each time you run swa login
  3. Manually provide the Deployment Token for your current project (see SWA CLI docs). You will also need to provide --app-name and --resource-group-name
  4. Manually provide --client-id, --client-secret, --app-name and --resource-group-name.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Static Web Apps CLI - Azure documentation
libsecret -1.so.0: cannot open shared object file: No such file or directory ​. Context​. When using swa login , the flag --use-keychain is...
Read more >
Containerizing .net core mvc fails with missing libsecret-1.so.0
0 : cannot open shared object file: No such file or directory; at Microsoft.Identity.Client.Extensions.
Read more >
unable to load shared library 'libsecret-1.so.0' - Stack Overflow
It didn't work for me, but I am using a docker container that doesn't have full access to apt. I can't install libsecret-1-dev....
Read more >
Hibernate, suspend, hybrid sleep functions work incorrectly
I can't use hibernate, hybrid sleep or suspend functions because they ... libgepub-0.7.so.0: cannot open shared object file: No such file or ...
Read more >
How To Solve "cannot open shared object file" Error in Ubuntu ...
Fix ing 'cannot open shared object file: No such file or directory' error. One quick way to fix this “error while loading shared...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found