plugins icon indicating copy to clipboard operation
plugins copied to clipboard

psscriptanalyzer hanging

Open sheldonhull opened this issue 1 year ago • 6 comments

I'm on latest version of trunk 1.22.2 and plugins were just updated v1.6.1. I love that there is a psscriptanalyzer option, but this is the second time I've tried to use and both had timeouts.

Never seems to return and just hangs.

config that seems relevant. Any idea what might be causing this?

version: '0.1'
cli:
  version: 1.22.2
  shell_hooks:
    path_add:
      - '${workspace}/tools'
plugins:
  sources:
    - id: trunk
      ref: v1.6.1
      uri: https://github.com/trunk-io/plugins
lint:
  enabled:
    - [email protected]
tools:
  enabled:
    - [email protected]
    - [email protected]

CleanShot 2024-08-05 at 18 38 41

CleanShot 2024-08-05 at 18 40 57

This also applied when I tried to run trunk fmt first, and it kept hanging.

sheldonhull avatar Aug 05 '24 23:08 sheldonhull

Hi! Sorry that you're running into this. We are investigating a similar issue with trufflehog, but we don't yet have a fix. In the meantime, you should be able to trunk daemon shutdown and then rerun and be up and running again. We will keep investigating to identify the root cause. If this doesn't fix your problem, please let us know

TylerJang27 avatar Aug 06 '24 02:08 TylerJang27

⬆️ bump. Any knowledge on why this is failing? I'd like to have powershell scripts linted and formatted as part of the stack but need to ensure it's fast and not hanging.

sheldonhull avatar Sep 23 '24 19:09 sheldonhull

Sorry, it seems to be a different issue from trufflehog, which has to do with a batching bug. We will keep looking into this, but last I checked it is an issue with psscriptanalyzer spawning child processes and disconnecting from them, which is why we can't currently support it on Mac. It's a race condition related to their execution flow, but we don't have a clean way to wrap it on our end yet.

TylerJang27 avatar Sep 23 '24 20:09 TylerJang27

Ok, this is useful to know. How about a custom action, would just invoking it myself make any difference in the way you are executing if I install it as a tool?

sheldonhull avatar Oct 02 '24 17:10 sheldonhull

Not that I know of. Also, CLI version 1.22.6 was just released which fixes the trufflehog hanging bug. If you could give that a try if you have a reliable repro for the psscriptanalyzer hanging, please let us know.

TylerJang27 avatar Oct 02 '24 17:10 TylerJang27

Opened this issue up as I notice that the manual invocation of formatter fails regardless of in trunk or not. Sounds related based on your mention.

https://github.com/PowerShell/PSScriptAnalyzer/issues/2031

sheldonhull avatar Oct 02 '24 17:10 sheldonhull