metalbear-co / mirrord

Connect your local process and your cloud environment, and run local code in cloud conditions.
https://mirrord.dev
MIT License
3.74k stars 101 forks source link

JetBrains Plugin: mirrord.json config fs disabled not working #900

Closed f-blass closed 1 year ago

f-blass commented 1 year ago

Bug Description

When using the config "fs": "disabled" in the mirrord.json config file of the JetBrains plugin I get the error

java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

Feature is described here: https://mirrord.dev/docs/overview/configuration/#tab-pane_feature_fs_anyOf_i1_anyOf_i0

Steps to Reproduce

  1. Use mirrord.json config as below
  2. Start a hello world example (in my case GoLang) with mirrord plugin enabled
  3. After selecting the target pod the error messages appears
{
    "accept_invalid_certificates": false,
    "feature": {
        "network": {
            "incoming": "mirror",
            "outgoing": true
        },
        "fs": "disabled",
        "env": true
    }
}

Backtrace

No response

Relevant Logs

No response

Your operating system and version

MacBook Pro M1 Max; macOS 13.1 (22C65)

Local process

/private/var/folders/lb/y5b0sgds5nv7z_vr4y9z68kc0000gn/T/GoLand/___1go_build_playground_http: Mach-O 64-bit executable arm64

Local process version

No response

Additional Info

mirrord plugin version 3.16.2

aviramha commented 1 year ago

It seems that the page is outdated, can you try local instead of disabled? (disabled is deprecated, replaced by local)

aviramha commented 1 year ago

Okay reading the error now I see that it's saying it's not a valid JSON which is weird. Can you upload the mirrord.json file as a file?

f-blass commented 1 year ago

mirrord.json.txt mirrord-v2.json.txt

Renamed to .txt because Github does not allow .json files

aviramha commented 1 year ago

Thank you! I'm 88% sure this is cause you used "fs" : "disabled" instead of local. Can you retry with local instead?

f-blass commented 1 year ago

Thanks for the super quick response again! Yes it is indeed working with "fs" : "local".

Still interesting to see this error. When using any other non-existing value I just see the error message failed launch

aviramha commented 1 year ago

Yes, it's kinda cryptic error but for good reason (i.e it's not a bug that can be handled by user) The issue is when using disabled it prints an error that it's deprecated into the stdout, so when we try to parse the stdout instead of getting a valid json we read "deprecated" message then fail on it. Next time we won't use writing to stdout for deprecation messages (use stderr). I removed ( #901 ) disabled from our code anyway since it was in deprecated mode for quite some time, and also we have a PR to update docs https://github.com/metalbear-co/mirrord.dev/pull/50.

Thanks for reporting this!