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

[ BUG ] 400: The ids parameter must be present... error when using Turkish display language #370

Open
bk-cs opened this issue Nov 30, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@bk-cs
Copy link
Collaborator

bk-cs commented Nov 30, 2023

Describe the bug
When using Turkish as your default display language, the following error is produced when using various PSFalcon commands:
{"code":400,"message":"The \u0027ids\u0027 parameter must be present at least once."}

To Reproduce
Install the Turkish language pack, set it as default, and attempt to use PSFalcon commands like Add-FalconSensorTag, Get-FalconHost -Detailed, etc.

Environment (please complete the following information):

  • OS: Windows 10
  • PowerShell: 5.1
  • PSFalcon: Likely any version
@bk-cs bk-cs added the bug Something isn't working label Nov 30, 2023
@bk-cs bk-cs self-assigned this Nov 30, 2023
@bk-cs
Copy link
Collaborator Author

bk-cs commented Nov 30, 2023

The initial bug report for this issue was specifically related to the Add-FalconSensorTag command, but after some testing I was able to reproduce it with any command that took identifier values and submitted them as part of a Json body.

The issue is due to how Turkish represents an uppercase i and that regex matching in PowerShell is not case insensitive by default when using Turkish (or possibly any language other than English). PSFalcon uses a private function called Build-Content to convert a user's input into a properly formatted Json body, which basically works like this:

  • Check user input against the expected format for the related submission to the target API
  • If the user's input needs to be renamed (for example, from Id to ids), check the alias attribute in PowerShell, and use it when present
  • Compare the users input (i.e. 'ids' -match 'Ids') and add input to the Json body

This failed in Turkish because ids would never match Ids (but does in English). The simplest fix seems to be to update all of the commands to use a lowercase alias when switching Id, to convert it to ids (rather than the current Ids), which will behave as expected. The fix will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant