product-microgateway icon indicating copy to clipboard operation
product-microgateway copied to clipboard

Unable to build project with System user (Super user) windows

Open umerasir opened this issue 4 years ago • 3 comments

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:

umerasir avatar Apr 28 '20 16:04 umerasir

@ShalkiWenushika , could you please have a look

Rajith90 avatar Jul 17 '20 06:07 Rajith90

@ShalkiWenushika , could you please have a look

Added a git issue in ballerina-lang: https://github.com/ballerina-platform/ballerina-lang/issues/24861

ShalkiWenushika avatar Jul 21 '20 07:07 ShalkiWenushika

@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.

ShalkiWenushika avatar Jul 21 '20 07:07 ShalkiWenushika