dbeaver / dbeaver/dbeaver

Connection shell commands unexpected behaviour

Open
#17,801 1 comment 0 reactions 0 assignees View on GitHub
xo:linux xo:macos
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 8h
Merged PRs (30d)
188

Description

### Description

I was attempting to use the following script in the Connection setting -> Shell commands "before connect" section in order to create an ssh tunnel to AWS recourse that frequently changes location the code is:
```
instanceId=`aws ssm describe-instance-information --filters "Key=tag:Name,Values=name-of-db" --profile PROFILE-NAME --region eu-west-1 | grep InstanceId | cut -d'"' -f4`
aws ssm start-session --target $instanceId --document-name AWS-StartPortForwardingSession --parameters "portNumber=[50000],localPortNumber=[50001]" --region eu-west-1 --profile PROFILE-NAME
```

upon connecting I get the below error:
```
Can't start process
Cannot run program "instanceId=`aws" (in directory "/Users/peter.maltby1/scripts"): error=2, No such file or directory
Cannot run program "instanceId=`aws" (in directory "/Users/peter.maltby1/scripts"): error=2, No such file or directory
error=2, No such file or directory
error=2, No such file or directory

```

Some investigation has led to me seeing the output of $PATH is not correct, however even when manually entering the path to the above commands " the desired outcome is still not reached, I can confirm the script runs on my system outside of DBeaver.

Apologies as I only have the above hardware to attempt this on so am uncertain if this is a system-specific bug, or whether I'm misunderstanding how to use the Shell commands and its limitations as I could not find much documentation. Thanks.

### DBeaver Version

Community 22.2.1.202209251341

### Operating System

macOS Monterey v 12.5.1

### Database and driver

n/a

### Steps to reproduce

run above script inside shell commands.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.