Unable to update channel config using Fabric SDK Java: field "common.ConfigUpdate.channel_id" contains invalid UTF-8

358 views Asked by At

Network setup:

The network is setup with 1 orderer + 2 organizations with 2 peers each (2 * 2 = 4 peers).

I don't think there's a problem with the network, nor with the crypto materials, the channel config transactions, since I've done similar things using Fabric SDK Go without going into this kind of problem.

What I have done:

The error occurs after I created the channel "mychannel", added two peers of the client org to the channel, initialized the channel using Fabric SDK Java and then tried to update the channel.

Before I tried to invoke channel.updateChannelConfiguration() to apply the config tx file Org1MSPanchors.tx, I managed to get the signatures from the admins of both the orgs.

The key lines (the project is written in Kotlin, the following is the Java equivalent):

var updateConfig = new UpdateChannelConfiguration(new File("path/to/file.tx"));
// The signatures have been created from the admins of the 2 orgs.
channel.updateChannelConfiguration(updateConfig, signatures);

Logs:

After the invocation, the program crashed with the following info.

Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: Channel mychannel, send transaction failed on orderer OrdererClient{id: 4, channel: mychannel, name: orderer.***.com, url: grpcs://localhost:7050}. Reason: Channel mychannel orderer orderer.***.com status returned failure code 400 (BAD_REQUEST) during orderer next
    at org.hyperledger.fabric.sdk.OrdererClient.sendTransaction(OrdererClient.java:240) ~[fabric-sdk-java-1.4.13.jar:na]
    at org.hyperledger.fabric.sdk.Orderer.sendTransaction(Orderer.java:164) ~[fabric-sdk-java-1.4.13.jar:na]
    at org.hyperledger.fabric.sdk.Channel.sendUpdateChannel(Channel.java:549) ~[fabric-sdk-java-1.4.13.jar:na]
    at org.hyperledger.fabric.sdk.Channel.updateChannelConfiguration(Channel.java:455) ~[fabric-sdk-java-1.4.13.jar:na]
    at org.hyperledger.fabric.sdk.Channel.updateChannelConfiguration(Channel.java:412) ~[fabric-sdk-java-1.4.13.jar:na]
    at com.***.util.SDKUtil$Companion.updateChannel(SDKUtil.kt:68) ~[main/:na]
    at com.***.***Application.configureChannel(FjstApplication.kt:76) ~[main/:na]
    at com.***.***Application.access$configureChannel(FjstApplication.kt:19) ~[main/:na]
    at com.***.***Application$commandLineRunner$2.run(FjstApplication.kt:54) ~[main/:na]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:804) [spring-boot-2.4.0.jar:2.4.0]
    ... 5 common frames omitted
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: Channel mychannel orderer orderer.***.com status returned failure code 400 (BAD_REQUEST) during orderer next
    at org.hyperledger.fabric.sdk.OrdererClient$1.onNext(OrdererClient.java:186) ~[fabric-sdk-java-1.4.13.jar:na]

And the docker logs of orderer.***.com:

2020-12-14 09:14:48.443 UTC [orderer.commmon.multichannel] newChain -> INFO 00b Created and starting new chain mychannel
2020-12-14 09:14:48.451 UTC [comm.grpc.server] 1 -> INFO 00c streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.128.1:35988 grpc.code=OK grpc.call_duration=60.307408ms
2020-12-14 09:15:01.201 UTC [comm.grpc.server] 1 -> INFO 00d streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.128.1:35988 grpc.code=OK grpc.call_duration=1.770753ms
2020-12-14 09:15:01.208 UTC [orderer.common.broadcast] ProcessMessage -> WARN 00e [channel: mychannel] Rejecting broadcast of config message from 192.168.128.1:35988 because of error: error applying config update to existing channel 'mychannel': error authorizing update: proto: field "common.ConfigUpdate.channel_id" contains invalid UTF-8
2020-12-14 09:15:01.208 UTC [comm.grpc.server] 1 -> INFO 00f streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=192.168.128.1:35988 grpc.code=OK grpc.call_duration=349.969µs

The config and network files:

https://1drv.ms/u/s!Aj_rPvkyS8y8gtsXEaKBXD1riM12CQ?e=jkMeYn

Please help:

If a solution is not obvious, could you please tell me what the possible causes are?

Thanks!

0

There are 0 answers