You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This worked a few months ago, I opened my devcontainer that I didn't modify, but it downloaded a new version of the dataApiBuilder.
This is the script I'm using to run (I'm ignoring my functions by now until the database works again):
#!/bin/bash. .env
>&2echo$(hugo -M --printI18nWarnings | grep i18n)# check if first parameter is "prod"if [ "$1"=="prod" ];thenecho"Starting staging server"
run="hugo server -M -e staging -p 1313 --disableFastRender"elseecho"Starting development server"
run="hugo server -M -e development -D -p 1313"fi# Workaround until this issue is fixed: https://github.com/Azure/azure-functions-core-tools/issues/3594sw# dotnet clean ../backend/functions
AzureWebJobsStorage=$STORAGE_CONNECTION_STRING swa start http://localhost:1313 --run "$run" -V silly --data-api-location "../swa-db-connections"# --api-location ../backend/functions
Log:
Starting development server
Welcome to Azure Static Web Apps CLI (2.0.4)
Getting config file options from "swa-cli.config.json"...
Config file does not exist at "swa-cli.config.json"
***********************************************************************
* WARNING: This emulator may not match the cloud environment exactly. *
* Always deploy and test your app in Azure. *
***********************************************************************
Checking if 0.0.0.0:4280 is accepting TCP connections...
Port 4280 is available. Use it.
Resolved port number: 4280
appDevserverUrl provided, we will try connect to dev server at .
Data Api Folder found: /workspaces/user/swa-db-connections
Trying to read workflow config with values:
- appLocation: /workspaces/user/www
- outputLocation: http://localhost:1313
- apiLocation: <undefined>
No workflow config folder found at /workspaces/user/www/.github/workflows
Validating user workflow config (BEFORE):
- appLocation: /workspaces/user/www
- outputLocation: http://localhost:1313
- apiLocation: <undefined>
Validating user workflow config (AFTER):
- appLocation: /workspaces/user/www
- apiLocation: <undefined>
- outputLocation: http://localhost:1313
- dataApiLocation: <undefined>
User workflow config:
- appLocation: /workspaces/user/www
- apiLocation: <undefined>
- outputLocation: http://localhost:1313
- dataApiLocation: <undefined>
Running dab --version
dab is not installed.
Setting executable permissions for data-api-builder binary
DataApiBuilder found: /home/vscode/.swa/dataApiBuilder/1.3.19/Microsoft.DataApiBuilder. Using this to start data-api server
Running cd "/workspaces/user/swa-db-connections" && "/home/vscode/.swa/dataApiBuilder/1.3.19/Microsoft.DataApiBuilder" start -c staticwebapp.database.config.json --no-https-redirect
Starting the SWA emulator with the following configuration:
- ssl:
- 0: false
- 1: <undefined>
- 2: <undefined>
- env:
- SWA_RUNTIME_CONFIG_LOCATION: /workspaces/user/www
- SWA_RUNTIME_WORKFLOW_LOCATION: <undefined>
- SWA_CLI_DEBUG: silly
- SWA_CLI_API_PORT: 7071
- SWA_CLI_APP_LOCATION: /workspaces/user/www
- SWA_CLI_OUTPUT_LOCATION: http://localhost:1313
- SWA_CLI_API_LOCATION: <undefined>
- SWA_CLI_DATA_API_LOCATION: /workspaces/user/swa-db-connections
- SWA_CLI_DATA_API_PORT: 5000
- SWA_CLI_HOST: 0.0.0.0
- SWA_CLI_PORT: 4280
- SWA_CLI_APP_SSL: false
- SWA_CLI_APP_SSL_CERT: <undefined>
- SWA_CLI_APP_SSL_KEY: <undefined>
- SWA_CLI_STARTUP_COMMAND: hugo server -M -e development -D -p 1313
- SWA_CLI_VERSION: 2.0.4
- SWA_CLI_SERVER_TIMEOUT: 60
- SWA_CLI_OPEN_BROWSER: false
- commands:
- swa: node "/usr/local/share/nvm/versions/node/v18.20.7/lib/node_modules/@azure/static-web-apps-cli/dist/msha/server.js"
- api: <undefined>
- dataApi: cd "/workspaces/user/swa-db-connections" && "/home/vscode/.swa/dataApiBuilder/1.3.19/Microsoft.DataApiBuilder" start -c staticwebapp.database.config.json --no-https-redirect
- run: cd "/workspaces/user/www" && hugo server -M -e development -D -p 1313
Watching for changes in /workspaces/user/www/{assets,content,i18n,layouts,package.json,static,themes}
Watching for config changes in /workspaces/user/www/hugo.toml, /workspaces/user/www/go.mod
Start building sites …
hugo v0.145.0-666444f0a52132f9fec9f71cf25b441cc6a4f355+extended linux/amd64 BuildDate=2025-02-26T15:41:25Z VendorInfo=gohugoio
WARN Dart Sass: DEPRECATED [import]: /workspaces/user/www/themes/hugo-scroll/assets/css/_index.scss:1:8: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
More info and automated migrator: https://sass-lang.com/d/import
WARN Dart Sass: DEPRECATED [import]: /workspaces/user/www/themes/hugo-scroll/assets/css/_index.scss:4:8: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
More info and automated migrator: https://sass-lang.com/d/import
WARN Dart Sass: DEPRECATED [import]: /workspaces/user/www/themes/hugo-scroll/assets/css/_index.scss:7:8: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
More info and automated migrator: https://sass-lang.com/d/import
WARN Dart Sass: DEPRECATED [import]: /workspaces/user/www/themes/hugo-scroll/assets/css/_index.scss:10:8: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
More info and automated migrator: https://sass-lang.com/d/import
| ES | EN | FR
-------------------+-----+-----+------
Pages | 24 | 21 | 21
Paginator pages | 0 | 0 | 0
Non-page files | 0 | 0 | 0
Static files | 130 | 130 | 130
Processed images | 0 | 0 | 0
Aliases | 1 | 0 | 0
Cleaned | 0 | 0 | 0
Built in 761 ms
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
Information: Microsoft.DataApiBuilder 1.3.19
Information: User provided config file: staticwebapp.database.config.json
Loading config file from /workspaces/user/swa-db-connections/staticwebapp.database.config.json.
Information: Loaded config file: staticwebapp.database.config.json
Information: Setting default minimum LogLevel: Debug for Development mode.
Starting the runtime engine...
Redirecting to https is disabled.
Loading config file from /workspaces/user/swa-db-connections/staticwebapp.database.config.json.
Reading content from staticwebapp.config.json...
Parsing /workspaces/user/www/static/staticwebapp.config.json...
Monitoring config: staticwebapp.database.config.json for hot-reloading.
warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
Storing keys in a directory '/home/vscode/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning
Content parsed successfully
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[62]
User profile is available. Using '/home/vscode/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Found configuration file:
/workspaces/user/www/static/staticwebapp.config.json
Validating dev server config:
- url: http://localhost:1313
- timeout: 60
Checking if localhost:1313 is accepting TCP connections...
Using dev server for static content:
http://localhost:1313
Azure Static Web Apps emulator started at http://0.0.0.0:4280. Press CTRL+C to exit.
info: Azure.DataApiBuilder.Service.Startup[0]
Successfully completed runtime initialization.
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://[::]:8080
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /workspaces/user/swa-db-connections
And here's the output of netstat -panout (see, no port 5000 being used, but 8080 for the data api)
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name Timer
tcp 0 0 0.0.0.0:4280 0.0.0.0:* LISTEN 19501/node off (0.00/0/0)
tcp 0 0 127.0.0.1:43107 0.0.0.0:* LISTEN 281/node off (0.00/0/0)
tcp 0 0 127.0.0.1:1313 0.0.0.0:* LISTEN 19505/hugo off (0.00/0/0)
tcp 0 0 127.0.0.1:1313 127.0.0.1:43762 ESTABLISHED 19505/hugo keepalive (3.34/0/0)
tcp 0 0 127.0.0.1:43107 127.0.0.1:56248 CLOSE_WAIT 281/node off (0.00/0/0)
tcp 0 0 127.0.0.1:43832 127.0.0.1:1313 ESTABLISHED 19501/node keepalive (3.82/0/0)
tcp 0 0 127.0.0.1:43107 127.0.0.1:34774 ESTABLISHED 503/node off (0.00/0/0)
tcp 0 0 127.0.0.1:1313 127.0.0.1:43924 ESTABLISHED 19505/hugo keepalive (3.34/0/0)
tcp 0 0 127.0.0.1:43107 127.0.0.1:34770 ESTABLISHED 281/node off (0.00/0/0)
tcp 0 0 127.0.0.1:57500 127.0.0.1:1313 ESTABLISHED 281/node off (0.00/0/0)
tcp 0 0 127.0.0.1:1313 127.0.0.1:57500 ESTABLISHED 19505/hugo keepalive (2.06/0/0)
tcp 0 0 127.0.0.1:34774 127.0.0.1:43107 ESTABLISHED 445/node off (0.00/0/0)
tcp 0 0 127.0.0.1:43107 127.0.0.1:33528 CLOSE_WAIT 281/node off (0.00/0/0)
tcp 0 0 127.0.0.1:43107 127.0.0.1:55246 CLOSE_WAIT 281/node off (0.00/0/0)
tcp 0 0 127.0.0.1:1313 127.0.0.1:43832 ESTABLISHED 19505/hugo keepalive (3.34/0/0)
tcp 0 0 127.0.0.1:1313 127.0.0.1:43932 ESTABLISHED 19505/hugo keepalive (12.94/0/0)
tcp 0 0 127.0.0.1:49872 127.0.0.1:43107 ESTABLISHED 20181/node off (0.00/0/0)
tcp 0 0 172.17.0.2:57902 140.82.121.5:443 ESTABLISHED 503/node keepalive (44.53/0/0)
tcp 0 0 127.0.0.1:34770 127.0.0.1:43107 ESTABLISHED 416/node off (0.00/0/0)
tcp 0 0 127.0.0.1:56938 127.0.0.1:43107 ESTABLISHED 21783/node off (0.00/0/0)
tcp 0 0 127.0.0.1:43107 127.0.0.1:56938 ESTABLISHED 281/node off (0.00/0/0)
tcp 0 0 127.0.0.1:43924 127.0.0.1:1313 ESTABLISHED 19501/node keepalive (3.90/0/0)
tcp 0 0 172.17.0.2:57886 140.82.121.5:443 ESTABLISHED 503/node keepalive (43.98/0/0)
tcp 0 0 127.0.0.1:43762 127.0.0.1:1313 ESTABLISHED 19501/node keepalive (3.82/0/0)
tcp 0 0 127.0.0.1:43932 127.0.0.1:1313 ESTABLISHED 19501/node keepalive (3.26/0/0)
tcp 0 0 172.17.0.2:57910 140.82.121.5:443 ESTABLISHED 503/node keepalive (44.89/0/0)
tcp 0 0 127.0.0.1:1313 127.0.0.1:40418 ESTABLISHED 19505/hugo keepalive (14.22/0/0)
tcp 0 0 127.0.0.1:43107 127.0.0.1:45762 CLOSE_WAIT 281/node off (0.00/0/0)
tcp 0 0 127.0.0.1:40418 127.0.0.1:1313 ESTABLISHED 281/node off (0.00/0/0)
tcp 0 0 172.17.0.2:53456 20.189.172.33:443 TIME_WAIT - timewait (29.48/0/0)
tcp 0 0 172.17.0.2:47196 140.82.113.22:443 ESTABLISHED 503/node keepalive (45.94/0/0)
tcp 0 0 127.0.0.1:43107 127.0.0.1:49872 ESTABLISHED 281/node off (0.00/0/0)
tcp6 0 0 :::8080 :::* LISTEN 19503/Microsoft.Dat off (0.00/0/0)
The text was updated successfully, but these errors were encountered:
After playing around with DAB and running it manually to test it, I've managed to workaround the issue by setting an environment value like explained here: Azure/data-api-builder#1425
So now my command line looks like this, to enforce the port 5000 usage:
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
?--port
) and accessing the CLI from that port:4280
ℹ️ NOTE: Make sure to enable debug logs when running any
swa
commands using--verbose=silly
Describe the bug
When trying to use any graph query the server returns 502 Bad Gateway
It looks like the new dataApiBuilder v1.3.19 uses port 8080 as default instead of port 5000 like before, and it stopped working with the swa emulator.
See in the variables
But during the startup we can see:
And here a snippet of the logs when it tries to access the database
To Reproduce
Steps to reproduce the behavior:
--data-api-location "../swa-db-connections"
Here's a snippet of the code I'm using for running a query:
Expected behavior
Identify the DataApiBuilder port instead of using the fixed 5000
Desktop (please complete the following information):
Additional context
This worked a few months ago, I opened my devcontainer that I didn't modify, but it downloaded a new version of the dataApiBuilder.
This is the script I'm using to run (I'm ignoring my functions by now until the database works again):
Log:
And here's the output of netstat -panout (see, no port 5000 being used, but 8080 for the data api)
The text was updated successfully, but these errors were encountered: