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]: Error message in bal pack when the token is invalid #41785

Closed
NirashaSewwandi opened this issue Nov 29, 2023 · 2 comments · Fixed by #42152
Closed

[Bug]: Error message in bal pack when the token is invalid #41785

NirashaSewwandi opened this issue Nov 29, 2023 · 2 comments · Fixed by #42152
Assignees
Labels
Area/ProjectAPI Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug userCategory/Compilation

Comments

@NirashaSewwandi
Copy link
Contributor

Description

I used bal new --template lib hello to make a library and try to do bal pack. I had a invalid token in the Settings.toml
Got this error
[2023-11-29 09:40:50,990] SEVERE {b7a.log.crash} - closed
java.lang.IllegalStateException: closed
at okio.RealBufferedSource.select(RealBufferedSource.kt:221)
at okhttp3.internal.Util.bomAwareCharset(Util.java:467)
at okhttp3.ResponseBody.string(ResponseBody.java:181)
at org.ballerinalang.central.client.CentralAPIClient.handleUnauthorizedResponse(CentralAPIClient.java:1707)
at org.ballerinalang.central.client.CentralAPIClient.resolveDependencies(CentralAPIClient.java:895)
at io.ballerina.projects.internal.repositories.RemotePackageRepository.fromPackageResolutionResponse(RemotePackageRepository.java:364)
at io.ballerina.projects.internal.repositories.RemotePackageRepository.getPackageMetadata(RemotePackageRepository.java:294)
at io.ballerina.projects.internal.environment.DefaultPackageResolver.resolvePackageMetadata(DefaultPackageResolver.java:170)
at io.ballerina.projects.internal.ResolutionEngine.resolveDirectDependencies(ResolutionEngine.java:248)
at io.ballerina.projects.internal.ResolutionEngine.populateStaticDependencyGraph(ResolutionEngine.java:173)
at io.ballerina.projects.internal.ResolutionEngine.resolveDependencies(ResolutionEngine.java:97)
at io.ballerina.projects.PackageResolution.resolveSourceDependencies(PackageResolution.java:290)
at io.ballerina.projects.PackageResolution.buildDependencyGraph(PackageResolution.java:232)
at io.ballerina.projects.PackageResolution.(PackageResolution.java:103)
at io.ballerina.projects.PackageResolution.from(PackageResolution.java:110)
at io.ballerina.projects.PackageContext.getResolution(PackageContext.java:251)
at io.ballerina.projects.Package.getResolution(Package.java:154)
at io.ballerina.cli.task.CompileTask.execute(CompileTask.java:112)
at io.ballerina.cli.TaskExecutor.executeTasks(TaskExecutor.java:40)
at io.ballerina.cli.cmd.PackCommand.execute(PackCommand.java:256)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at io.ballerina.cli.launcher.Main.main(Main.java:58)

Steps to Reproduce

bal new --template lib hello
Use a invalid token in Settings.toml
bal pack

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Nov 29, 2023
@nipunayf nipunayf added Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Area/ProjectAPI and removed needTriage The issue has to be inspected and labeled manually labels Nov 29, 2023
@Thevakumar-Luheerathan Thevakumar-Luheerathan moved this from In Progress to On Hold in Ballerina Team Main Board Feb 14, 2024
@Thevakumar-Luheerathan
Copy link
Member

This issue occurs when we try to consume the body from already closed response. Consuming body again and again from a Response is not possible.

Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/ProjectAPI Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug userCategory/Compilation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants