Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suddently getting Error: failed to start plugin manager: too many open files #4035

Open
farzadmf opened this issue Dec 18, 2023 · 11 comments
Open
Labels
bug Something isn't working needs reproduction Reproduction steps are not defined for this issue stale No recent activity has been detected on this issue/PR and it will be closed

Comments

@farzadmf
Copy link

Describe the bug
My whole workflow is dependent on steampipe, and now it's failing with the following error:

Error: failed to start plugin manager: too many open files

Steampipe version (steampipe -v)
Steampipe v0.21.2

To reproduce
Not sure what happened TBH, but even doing steampipe plugin list doesn't work.

Expected behavior
steampipe should be working fine without me changing anything (except for maybe upgrading things)

Additional context
I tried removing ~/.steampipe directory, but still getting the error

@farzadmf farzadmf added the bug Something isn't working label Dec 18, 2023
@binaek
Copy link
Contributor

binaek commented Dec 19, 2023

@farzadmf sorry to see that you have hit this snag.

How are you using steampipe? If you find yourself doing steampipe query again and again, a steampipe service start at the start and a service stop at the end usually helps.

Can you check if there are any stray steampipe processes? I have seen a simple ps -ef | grep steampipe helps.

Does it help if you restart your system?

@farzadmf
Copy link
Author

@binaek thank you for your reply.

I tried everything; killing the processes, deleting directories, etc., but nothing worked.

Restarting my computer did solve the issue, but I think you can agree that it's not a solution, rather a [hacky] workaround, given that it very well may be impossible to restart the system while you're actively working on something.

And regarding steampipe service, I think it would add a significant delay to my operations as the start and stop operations both take time, and that would basically render steampipe as "impossible to use because it takes too long to run" and just go with reliable native things (which, in my case at the moment, is aws CLI command)

@kaidaguerre
Copy link
Contributor

Hey @farzadmf sorry you've hit this issue. I totally agree, restarting the computer is not an acceptable long term solution. However if it unblocks you for now that is good.

If the problem recurs, one thing to do is the check if you have any stray steampipe processes by running

ps aux | grep steampipe

I'll leave this issue open for now and do a bit of digging

@judell
Copy link
Contributor

judell commented Dec 22, 2023

Hey @farzadmf can you please share details on which plugins you're loading, and roughly how many connections for each?

@farzadmf
Copy link
Author

Hey @judell , right now, I only have the aws plugin, and my workflow I'd say is "light" (at least I hope it is).

I'm running stp query "<my-query>" and I'd say I have a max of 2-3 calls in the subshell I'm creating in my script (and it would be a single subshell created by me running my script).

I started to face some issues (I had a similar issue way back; I think it can be found in the issues - I searched and found #3297), so after that, I'm doing pkill -f steampipe in my script's entry point (another hacky thing).

And, as I mentioned before, the only solution that worked was restarting my computer (killing processes, deleting directories, etc. nothing worked)

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale No recent activity has been detected on this issue/PR and it will be closed label Feb 22, 2024
@kaidaguerre kaidaguerre added the needs reproduction Reproduction steps are not defined for this issue label Mar 21, 2024
@kaidaguerre
Copy link
Contributor

hi @farzadmf sorry for the delay in getting back to this. Is this error still happening?

@farzadmf
Copy link
Author

Hey @kaidaguerre no problem. TBH, it happens time to time, along with other weird errors, some requiring me to delete the ~/.steampipe directory, some requiring me to reboot my system.

When I discovered steampipe, I was "OMG, this is the best thing", and I started putting it everywhere in my scripts (my only use case right now is aws), but then I started getting all these weird errors, and I can't trust steampipe anymore and little by little, I'm' going back to using aws CLI.

Honestly, I think my initial impression was correct and steampipe has GREAT potential, but at least for me, the UX has been VERY dissapointing. Every time I run my scripts, I'm like "I hope I've converted it to aws CLI otherwise it will probably give some random error"

When steampipe does work, it's amazing, but ...

@kaidaguerre
Copy link
Contributor

Hi @farzadmf I'm sorry to hear you continue to have issues. Intermittent issues such as this as particularly hard to track down - I have been unable to reproduce this locally.

What is the file limit per process on your system = ulimit -n

If it does recur, it would be interesting to get the results of running lsof to list the open files. In particular, finding the steampipe process using ps aux | grep steampipe, then passing that pid to lsof: lsof -p xxxx

@farzadmf
Copy link
Author

Thank you @kaidaguerre for the reply; I'll keep that in mind for next time.

As for the file limit, I think I've increased to its max: 65535

@github-actions github-actions bot removed the stale No recent activity has been detected on this issue/PR and it will be closed label Mar 22, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale No recent activity has been detected on this issue/PR and it will be closed label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs reproduction Reproduction steps are not defined for this issue stale No recent activity has been detected on this issue/PR and it will be closed
Projects
None yet
Development

No branches or pull requests

4 participants