sst: `npx sst tunnel` immediately exits
When following along with the Drizzle example, I’m unable to use a tunnel to connect to the database cluster in the VPC. After successfully installing the tunnel, opening the tunnel via npx sst dev or npx sst tunnel opens the tunnel, which then immediately exits.
SST Version: 3.2.73 OS: MacOS 14.5 (23F79)
My Repro Steps
- CD or Clone into the Drizzle Example, run
npm install. - Configure AWS credentials.
- Run
sudo npx sst tunnel install. - Run
npx sst dev.
After the VPC, Database, and Function get created, SST starts the Tunnel and Studio command, but the tunnel exits immediately with:
Tunnel
➜ Forwarding ranges
10.0.4.0/22
10.0.12.0/22
10.0.0.0/22
10.0.8.0/22
Waiting for connections...
✕ Make sure you have installed the tunnel with `sudo sst tunnel install`
[process exited]
When running npx sst tunnel --print-logs:
➜ aws-drizzle npx sst tunnel --print-logs
time=2024-11-01T10:53:11.389-04:00 level=INFO msg="checking for pulumi" path="/Users/taylor.steele/Library/Application Support/sst/bin/pulumi"
time=2024-11-01T10:53:11.529-04:00 level=INFO msg="checking for bun" path="/Users/taylor.steele/Library/Application Support/sst/bin/bun"
time=2024-11-01T10:53:11.540-04:00 level=INFO msg="initializing project" version=3.2.73
time=2024-11-01T10:53:11.540-04:00 level=INFO msg="esbuild building" out=/Users/taylor.steele/Sites/aws-drizzle/.sst/platform/sst.config.1730472791540.mjs
time=2024-11-01T10:53:11.542-04:00 level=INFO msg="esbuild built" outfile=/Users/taylor.steele/Sites/aws-drizzle/.sst/platform/sst.config.1730472791540.mjs
time=2024-11-01T10:53:11.542-04:00 level=INFO msg="evaluating config"
time=2024-11-01T10:53:11.578-04:00 level=INFO msg="config evaluated"
time=2024-11-01T10:53:11.581-04:00 level=INFO msg="checking platform"
time=2024-11-01T10:53:11.581-04:00 level=INFO msg="loading home"
time=2024-11-01T10:53:11.892-04:00 level=INFO msg="aws credentials found" region=us-east-1 profile=dev
time=2024-11-01T10:53:11.892-04:00 level=INFO msg="fetching bootstrap"
time=2024-11-01T10:53:12.081-04:00 level=INFO msg="found existing bootstrap" data="{\"version\":4,\"asset\":\"sst-asset-xkmstvnnxtdh\",\"assetEcrRegistryId\":\"340752840587\",\"assetEcrUrl\":\"340752840587.dkr.ecr.us-east-1.amazonaws.com/sst-asset\",\"state\":\"sst-state-xkmstvnnxtdh\"}"
time=2024-11-01T10:53:12.081-04:00 level=INFO msg="loaded config" app=aws-drizzle stage=taylorsteele
time=2024-11-01T10:53:12.082-04:00 level=INFO msg="INFO getting passphrase app=aws-drizzle stage=taylorsteele"
time=2024-11-01T10:53:12.262-04:00 level=INFO msg="INFO pulling state app=aws-drizzle stage=taylorsteele out=/Users/taylor.steele/Sites/aws-drizzle/.sst/.pulumi/stacks/aws-drizzle/taylorsteele.json"
time=2024-11-01T10:53:13.041-04:00 level=INFO msg="starting tunnel" cmd="[sudo -n -E /opt/sst/sst1 tunnel start --subnets 10.0.4.0/22,10.0.12.0/22,10.0.0.0/22,10.0.8.0/22 --host 54.160.41.106 --user ec2-user --print-logs]"
Tunnel
➜ Forwarding ranges
10.0.4.0/22
10.0.12.0/22
10.0.0.0/22
10.0.8.0/22
Waiting for connections...
time=2024-11-01T10:53:13.058-04:00 level=INFO msg="killing process" pid=65541
time=2024-11-01T10:53:13.058-04:00 level=ERROR msg="exited with error" err=<nil>
time=2024-11-01T10:53:13.059-04:00 level=INFO msg="process killed with term" pid=65541
time=2024-11-01T10:53:13.059-04:00 level=INFO msg="untracked process" pid=65541
✕ Make sure you have installed the tunnel with `sudo sst tunnel install`
When running sudo npx sst tunnel the tunnel works, but at the cost of changing the permissions in the .sst folder and the workspace json file in Library/Application Support/sst/workspaces. This works at the cost of needing elevated permissions to use other SST commands in the project. It would be preferable if I didn’t need to use sudo to run these commands.
Here’s the sst.config.ts for reference as well:
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: 'aws-drizzle',
removal: input?.stage === 'production' ? 'retain' : 'remove',
home: 'aws',
providers: {
aws: {
profile: 'dev',
},
},
};
},
async run() {
const vpc = new sst.aws.Vpc('MyVpc', { bastion: true, nat: 'ec2' });
const rds = new sst.aws.Postgres('MyPostgres', { vpc, proxy: true });
const api = new sst.aws.Function('MyApi', {
vpc,
url: true,
link: [rds],
handler: 'src/api.handler',
});
new sst.x.DevCommand('Studio', {
link: [rds],
dev: {
command: 'npx drizzle-kit studio',
},
});
return {
api: api.url,
};
},
});
Discord Reference: https://discord.com/channels/983865673656705025/983865673656705028/1300501887216390186
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 20 (11 by maintainers)
restarting the terminal had no effect resetting the repository with git clean -f -d -x and reinstalling the dependicies had no effect
restarting the computer had an effect. The tunnel works
Mac 13.3.1 (a) “sst”: “3.3.30”