static-web-apps-cli
static-web-apps-cli copied to clipboard
Cannot autolaunch D-Bus without X11 $DISPLAY on GitHub Codespaces (deploy)
Before filing this issue, please ensure you're using the latest CLI by running swa --version and comparing to the latest version on npm.
Are you accessing the CLI from the default port :4280 ?
- [ ] No, I am using a different port number (
--port) and accessing the CLI from that port - [x] Yes, I am accessing the CLI from port
:4280
Make sure you are accessing the URL printed in the console when running
swa start!
ℹ️ NOTE: Make sure to enable debug logs when running any swa commands using --verbose=silly
Describe the bug
When running swa deploy on GitHub Codespaces, I face the following error.
✖ Cannot autolaunch D-Bus without X11 $DISPLAY. This is not documented, so I am not sure what I miss and if GitHub Codespaces is just not supported.
To Reproduce Steps to reproduce the behavior:
- Go to GitHub Codespaces
- Install latest CLI version
- Run
npx swa deploy - See error
Expected behavior Deployment using the credentials of Azure CLI, where I am already logged in with.
Desktop (please complete the following information):
- OS: Ubuntu
- Version: Ubuntu 20.04.5 LTS
Additional context
@iMicknl ➜ /workspaces/semantic-search-demo (main) $ npx swa deploy
Welcome to Azure Static Web Apps CLI (1.0.2)
Using configuration "semantic-search-demo" from file:
/workspaces/semantic-search-demo/swa-cli.config.json
Deploying front-end files from folder:
/workspaces/semantic-search-demo/app/build
Deploying API from folder:
/workspaces/semantic-search-demo/api
Checking Azure session...
✖ Cannot autolaunch D-Bus without X11 $DISPLAY
@iMicknl ➜ /workspaces/semantic-search-demo (main) $ npx swa deploy --verbose=silly
Welcome to Azure Static Web Apps CLI (1.0.2)
Getting config file options from swa-cli.config.json...
Changed directory to /workspaces/semantic-search-demo
Using configuration "semantic-search-demo" from file:
/workspaces/semantic-search-demo/swa-cli.config.json
Deploying front-end files from folder:
/workspaces/semantic-search-demo/app/build
Deploying API from folder:
/workspaces/semantic-search-demo/api
No deployment token found. Trying interactive login...
Checking Azure session...
Executing authenticateWithAzureIdentity
- details:
- tenantId: <undefined>
- clientId: <undefined>
- clientSecret: <undefined>
- useKeychain: true
Keychain is enabled
Executing swaCliPersistencePlugin
Executing before cache access plugin
Machine ID: <hidden>
Invoking crypto service
Getting credentials
Getting credentials from native keychain
Getting keychain reference
isKeychainEnabled: true
KeychainCache: undefined
Attempting to load native keychain
Executing after cache access plugin
Machine ID: <hidden>
Invoking crypto service
Did TokenCacheContext cache changed: false
After cache access plugin. Done.
✖ Cannot autolaunch D-Bus without X11 $DISPLAY
Can you try these options in the following order and let us know which one worked for you:
- Disabling Keychain access using
--no-use-keychain. For instance:swa deploy --no-use-keychain. - Or, manually provide the Deployment Token for your current project (see SWA CLI docs). You will also need to provide
--app-nameand--resource-group - Or, manually provide
--client-id,--client-secret,--app-nameand--resource-group.
Please let us know which option worked for you so we can update the docs.
@manekinekko what is the intended audience of the deploy command? I am migrating from 0.x to 1.x and using swa deploy on CodeSpaces is giving me a hard time.
- First the issue mentioned here.
- While using
swa deploy -d token, I bump into a size limit. Removing"azure-functions-core-tools": "^4.x",. from my devDependencies solves this, but not my desired solution. - Using
swa deploy --no-use-keychainseems to work, but while choosing the tenant it won't provide me the name. Only the tenant id. Choosing the tenant requires me to log in again and then it seems to work. (until it tells me that it is linked to GitHub, even though the previous deployment to preview worked viaswa deploy -d token. - Trying
swa deploy -d tokenagain works and deploys the same version to preview. (it does not run / prompt for swa build first, thus I forgot). Runningswa buildandswa deploy -d tokenworks with the newest version now.
I would say that this CLI would especially be targetted for devs, for example using CodeSpaces, without having to do a lot of extra steps. Having an easy way to deploy a sample they download from GitHub, without configuring CI/CD etc. Is the feedback above valuable / already known?
Regarding this issue, option 2 seems to work (without providing the app name and resource group by the way).
Hey, is there any update on this? Trying to run swa cli inside a Github Codespace and this seems to be needed for login / deploy etc. It would be great to add a section on Codespaces / devcontainers and SWA tool to the docs, documenting the setup, port forwarding etc..