Comments (4)
This is not ideal, but is a side effect of a design decision we made for ease of use.
Internally there are two parts to the Steampipe CLI - a client and a server.
When you run steampipe service start
you are starting the server alone, making it available for multiple steampipe clients and postgres tools to connect to. The configuration of permissions and connections is done at a server level.
When you run steampipe query
we:
- Try to connect to an existing steampipe service that is running.
- If there is no service, start a "temporary service".
- Connect to the running service.
- Run our query.
- Disconnect our client.
- Stop the "temporary service" if we were the last client.
This approach makes steampipe query easy to use and allows you to run multiple clients in parallel. The negative effect is that the "temporary service" configuration is based on the first client to start it. This is what you are seeing.
If you are using multiple AWS profiles I highly recommend you set them up as different connections in steampipe - then you can reuse the same service and query both of them by just changing the search path - https://steampipe.io/docs/guides/search-path
But, as a workaround if you really want environment variable based control, you can use the --install-dir
and --port
arguments to start a second steampipe service in parallel. You should definitely checkout workspaces if you want to do this sort of thing - they make the configuration a lot easier and more flexible.
from steampipe.
This is perfectly understandable once you know how the product works. But for the user who doesn't know, or is concentrating on the work (rather than the tool) this behaviour is surprising and frustrating. As part of the core design, I recognize this will be hard to change, but if it can not be changed easily, then consider ways to make the behaviour more visibile.
Potential ideas:
- Call out current settings at the top of the console when using
steampipe query
- Call out the reuse of existing servers (and their process IDs) when querying.
- Create an easy ".info" command that shows the current profile and connection settings to support troubleshooting/discoverability of reuse
- have the steampipe session check that its environment matches the server instance environment regarding these behaviour-controlling values
- enable time-out of backend servers
This last one especially resonates with my experience, as I troubleshot the inconsistent results for 2+ hours. The forgotten console was three hours old, and a 5m timeout on the backend server would have shut down the conflicting server before the behaviour even appeared.
from steampipe.
I think steampipe should listen to a random local socket on each execution by default for standalone queries.
This solves a few issues:
- Allows concurrent execution
- Each execution gets its own environment variables
- Works even if port 9193 is in use
- Does not require a listening port on localhost, which is more secure
- Allows setting user permissions on the socket, which is more secure
from steampipe.
Unfortunately @shaicoleman, running two instances of steampipe at the same time (e.g. on different ports) means running two postgres instances simultaneously. This is only possible with two separate installation directories to store all of the postgres data files, configuration, etc. Doing this on-demand will take time to setup and create a lot of noise / storage on the machine.
Providing more feedback through the UI about reuse as @jlm0x017 suggests seems like the best option at this point I think?
from steampipe.
Related Issues (20)
- Add verbose timing mode
- errors from ExecuteSystemClientCall are not being returned, dues to variable shadow issue
- [ARM64 OCI CloudShell] Initializing database... FAILED! HOT 2
- Uninstalling a plugin don't remove the rate-limiter config from the table `steampipe_plugin_limiter`
- steampipe postgres size management HOT 5
- Ollama Steampipe Plugin
- `Hydrates` count in timing verbose mode should use integer formatting(e.g. `119,138`) HOT 1
- Bad build of Linux Arm FDW version 1.11.0
- Raspberry PI: initializing database failed HOT 3
- Steampipe returns 0 exit code even if `failed to export snapshot`(query)
- Tables from Azure and AWS returns this invalid memory address or nil pointer dereference HOT 1
- Query command should support legacy 'true' and 'false' for `--timing` flag
- Ability to get ALL inventory (exported to csv/whatever), so I can diff it between runs HOT 1
- Unusual query timing results with aggregator connection with caching enabled when some connections have errors
- Query time decreasing on subsequent queries with caching disabled HOT 1
- Docker Image for latest steampipe HOT 4
- setting autocomplete in workspaces files has no effect
- JSON metadata output should not contain scan info when `--timing=on`
- `sps` output not working
- fatal error: concurrent map read and map write HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from steampipe.