#bal build --cloud=docker fails

1 messages · Page 1 of 1 (latest)

silent oak
#

bal build --cloud=docker fails with following error

Compiling source
        charithr/github_trigger_test:0.1.0
error: compilation failed: The compiler extension in package 'ballerina:cloud:2.11.4' failed to complete. 'java.util.List io.ballerina.c2c.util.ProjectServiceInfo.getClientList()'

Ballerina version

Ballerina 2201.12.6 (Swan Lake Update 12)
Language specification 2024R1
Update Tool 1.5.0
plucky hinge
#

The issue seems to be due to two versions of ballerina/cloud package being included as dependencies.

ballerinax/trigger.github(0.10.0) depends on ballerina/cloud - 2.11.4.
When using the --cloud flag, ballerina/cloud dependency is injected by a language plugin, and as we are using Ballerina 2201.12.6, ballerina/cloud - 3.3.2 is being added.
This results in an error in dependency resolution.

The possible solutions to this issue will be to release a new version (0.11.0) of the trigger.github package with the cloud dependency version set to 3.3.2.
@cyan ermine

plucky hinge
#

As a workaround, you can try switching to 2201.11.x version until the new version of Github trigger is released.

silent oak
#

Hi @plucky hinge
Thanks for the quick response

I tried switching to 2201.11.0

Ballerina 2201.11.0 (Swan Lake Update 11)
Language specification 2024R1
Update Tool 1.5.1

But facing the following error

Compiling source
        charithr/github_trigger_test:0.1.0
error: compilation failed: The compiler extension in package 'ballerina:cloud:2.11.4' failed to complete. class io.ballerina.compiler.syntax.tree.NamedArgumentNode cannot be cast to class io.ballerina.compiler.syntax.tree.PositionalArgumentNode (io.ballerina.compiler.syntax.tree.NamedArgumentNode and io.ballerina.compiler.syntax.tree.PositionalArgumentNode are in unnamed module of loader 'app')
plucky hinge
#

Have you deleted the Dependencies.toml file?

silent oak
#

Following error appeared when trying to build after deletion

Compiling source
        charithr/github_trigger_test:0.1.0
ERROR [github_trigger_test] Two incompatible versions exist in the dependency graph: ballerina/cloud versions: 3.2.0, 2.5.2
error: package resolution contains errors

Following Dependencies.toml file was generated when running the application

Following error appears when trying to build after running

Compiling source
        charithr/github_trigger_test:0.1.0
error: compilation failed: The compiler extension in package 'ballerina:cloud:2.11.4' failed to complete. class io.ballerina.compiler.syntax.tree.NamedArgumentNode cannot be cast to class io.ballerina.compiler.syntax.tree.PositionalArgumentNode (io.ballerina.compiler.syntax.tree.NamedArgumentNode and io.ballerina.compiler.syntax.tree.PositionalArgumentNode are in unnamed module of loader 'app')
plucky hinge
silent oak
#

Listner is intialized as follows

listener github:Listener github = new (listenerConfig = {webhookSecret: webhookSecret}, listenOn = 8080);
silent oak
plucky hinge
#

Can you try initiating as below:

listener github:Listener github = new ({webhookSecret}, 8080);

silent oak
#

Tried this. Still the same