product-microgateway
product-microgateway copied to clipboard
Unable to build project with System user (Super user) windows
Description:
Unable to build project with System user (Super user) windows . Upon debugging the issue it turns out it parses "user.name" from environment variable to determine org/group and this is thrown when user name is ending with '$' e.g INRTW00023$
Steps to reproduce:
Build project with System user.
[ERROR]
micro-gw: Internal error occurred while executing command.
microgw.log
[2020-04-28 21:47:31,949] ERROR {org.wso2.apimgt.gateway.cli.cmd.Main} - Internal error occurred while executing command.
java.lang.IllegalArgumentException: Illegal group reference: group index is missing
at java.util.regex.Matcher.appendReplacement(Matcher.java:819)
at java.util.regex.Matcher.replaceAll(Matcher.java:955)
at java.lang.String.replaceAll(String.java:2223)
at org.ballerinalang.packerina.cmd.CommandUtil.initProject(CommandUtil.java:118)
at org.wso2.apimgt.gateway.cli.cmd.BuildCmd.initTarget(BuildCmd.java:337)
at org.wso2.apimgt.gateway.cli.cmd.BuildCmd.init(BuildCmd.java:279)
at org.wso2.apimgt.gateway.cli.cmd.BuildCmd.execute(BuildCmd.java:140)
at java.util.Optional.ifPresent(Optional.java:159)
at org.wso2.apimgt.gateway.cli.cmd.Main.main(Main.java:50)
Workaround
Clear user name from environment variable
Affected Product Version:
3.1.0
Environment details (with versions):
- OS: Windows
- Client:
- Env (Docker/K8s):
Optional Fields
Related Issues:
Suggested Labels:
Suggested Assignees:
@ShalkiWenushika , could you please have a look
@ShalkiWenushika , could you please have a look
Added a git issue in ballerina-lang: https://github.com/ballerina-platform/ballerina-lang/issues/24861
@umerasir, When I build the product-microgateway-3.1.0 in Windows with an Administrator-Local account which is having a username ending with "$" symbol, a build failure occurs with the microgw.log you mentioned. But I was unable to reproduce this issue when building the project as a system user from an account which is having a username ending with "$" symbol.