crowdin / crowdin-cli

A command-line client for the Crowdin API
https://crowdin.github.io/crowdin-cli
MIT License
250 stars 94 forks source link

can't do any thing in cli #846

Closed DancingSnow0517 closed 1 month ago

DancingSnow0517 commented 2 months ago

Describe the bug when i use command crowdin pull cli show the message [ERROR] class java.lang.Boolean cannot be cast to class java.lang.String (java.lang.Boolean and java.lang.String are in module java.base of loader 'bootstrap')

To Reproduce

  1. Configuration file:
    
    project_id: '720595'
    #api_token_env: CROWDIN_API_TOKEN
    api_token: ******
    base_path: '.'

preserve_hierarchy: true

files:

commit_message: New Crowdin translations by GitHub Action


2. Execute CLI command `crowdin pull`
3. See an error
  [ERROR] class java.lang.Boolean cannot be cast to class java.lang.String (java.lang.Boolean and java.lang.String are in module java.base of loader 'bootstrap')

**Environment:**
 - OS: Windows11

**Screenshots**
![image](https://github.com/user-attachments/assets/b26499ee-3071-47a5-9615-c92f6e26ec83)
andrii-bodnar commented 2 months ago

Hi @DancingSnow0517, could you please clarify the following:

DancingSnow0517 commented 2 months ago

Hi @DancingSnow0517, could you please clarify the following:

  • Java version
  • Crowdin CLI version
  • CLI installation methodl (how it was installed)

java version is zulu jdk17 cli version is 4.2.0 installation method: download from github release, double click install.bat with admin permission

andrii-bodnar commented 2 months ago

@DancingSnow0517 thanks for the details!

Could you please also provide a full backtrace of the command execution by using the --debug parameter?

For example:

crowdin pull --debug
DancingSnow0517 commented 2 months ago

@DancingSnow0517 thanks for the details!

Could you please also provide a full backtrace of the command execution by using the --debug parameter?

For example:

crowdin pull --debug
crowdin pull --debug
java.lang.ClassCastException: class java.lang.Boolean cannot be cast to class java.lang.String (java.lang.Boolean and java.lang.String are in module java.base of loader 'bootstrap')
at java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1856)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:280)
at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1856)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:632)
at com.crowdin.cli.properties.PropertiesWithFiles$PropertiesWithFilesConfigurator.checkProperties(PropertiesWithFiles.java:90)
at com.crowdin.cli.properties.PropertiesWithFilesBuilder.checkProperties(PropertiesWithFilesBuilder.java:184)
at com.crowdin.cli.properties.PropertiesWithFilesBuilder.checkProperties(PropertiesWithFilesBuilder.java:21)
at com.crowdin.cli.properties.PropertiesBuilder.build(PropertiesBuilder.java:177)
at com.crowdin.cli.properties.PropertiesBuilders.buildPropertiesWithFiles(PropertiesBuilders.java:19)
at com.crowdin.cli.commands.picocli.ActCommandWithFiles.getProperties(ActCommandWithFiles.java:25)
at com.crowdin.cli.commands.picocli.ActCommandWithFiles.getProperties(ActCommandWithFiles.java:11)
at com.crowdin.cli.commands.picocli.GenericActCommand.run(GenericActCommand.java:27)
at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
at picocli.CommandLine.execute(CommandLine.java:2174)
at com.crowdin.cli.commands.picocli.PicocliRunner.execute(PicocliRunner.java:38)
at com.crowdin.cli.Cli.main(Cli.java:16)
andrii-bodnar commented 2 months ago

@DancingSnow0517 thank you, I was able to reproduce this. It happens because of a YML parsing issue on the no: no_no line. The YML parser considers the no value to be a boolean.

Try wrapping it in quotes:

"no": no_no

Now the error is gone, but there is another problem with the language mapping configuration and the language codes used. Read more here - Language Mapping Configuration.

DancingSnow0517 commented 2 months ago

@DancingSnow0517 thank you, I was able to reproduce this. It happens because of a YML parsing issue on the no: no_no line. The YML parser considers the no value to be a boolean.

Try wrapping it in quotes:

"no": no_no

Now the error is gone, but there is another problem with the language mapping configuration and the language codes used. Read more here - Language Mapping Configuration.

how i use the language code in my custom language, like my configuratuon zhmeme, in old version cli, my configuratuon is work

andrii-bodnar commented 2 months ago

@DancingSnow0517 you can use the crowdin language list command to get right code for the mapping.