Skip to content

operations.spaces.list breaks for orgs with , in its name #714

@kdvolder

Description

@kdvolder

The problem was reported against STS for not being able to 'target' an org when that org has a comma in its name.

To reproduce I set up just such an org using pcf dev. Then I tried using cf-java-client to list spaces in the org and got this error message:

[main] DEBUG cloudfoundry-client.request - GET    https://api.local2.pcfdev.io:443/v2/organizations?q=name%20IN%20my,org&page=1
[cloudfoundry-client-nio-5] DEBUG cloudfoundry-client.token - Negotiating using token provider
[cloudfoundry-client-nio-5] DEBUG cloudfoundry-client.request - GET    https://api.local2.pcfdev.io:443/v2/info
[cloudfoundry-client-nio-7] DEBUG cloudfoundry-client.response - 200    https://api.local2.pcfdev.io:443/v2/info (32 ms)
[cloudfoundry-client-nio-7] WARN cloudfoundry-client.trust - Trusting SSL Certificate for login.local2.pcfdev.io:443
[cloudfoundry-client-nio-7] DEBUG cloudfoundry-client.trust - Trusted SSL Certificate for login.local2.pcfdev.io:443
[cloudfoundry-client-nio-7] DEBUG cloudfoundry-client.request - POST   https://login.local2.pcfdev.io:443/oauth/token
[cloudfoundry-client-nio-1] DEBUG cloudfoundry-client.response - 200    https://login.local2.pcfdev.io:443/oauth/token (237 ms)
[cloudfoundry-client-nio-1] DEBUG cloudfoundry-client.token - Refresh Token: 5f5d9a7035dd460393e63c036d854605-r
[cloudfoundry-client-nio-1] DEBUG cloudfoundry-client.token - Access Token: eyJhbGciOiJSUzI1NiIsImtpZCI6ImtleS0xIiwidHlwIjoiSldUIn0.eyJqdGkiOiJjZmE1ZTRmYzg2MjQ0MjEzOWRiOGRjNTE2NTFhMWQ4OSIsInN1YiI6ImI2NzE2N2NhLTQyYTYtNGE0My05NmIyLThlZjFiMGFlZDY1ZiIsInNjb3BlIjpbIm9wZW5pZCIsInJvdXRpbmcucm91dGVyX2dyb3Vwcy53cml0ZSIsInNjaW0ucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iLCJ1YWEudXNlciIsInJvdXRpbmcucm91dGVyX2dyb3Vwcy5yZWFkIiwiY2xvdWRfY29udHJvbGxlci5yZWFkIiwicGFzc3dvcmQud3JpdGUiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIiwiZG9wcGxlci5maXJlaG9zZSIsInNjaW0ud3JpdGUiXSwiY2xpZW50X2lkIjoiY2YiLCJjaWQiOiJjZiIsImF6cCI6ImNmIiwiZ3JhbnRfdHlwZSI6InBhc3N3b3JkIiwidXNlcl9pZCI6ImI2NzE2N2NhLTQyYTYtNGE0My05NmIyLThlZjFiMGFlZDY1ZiIsIm9yaWdpbiI6InVhYSIsInVzZXJfbmFtZSI6ImFkbWluIiwiZW1haWwiOiJhZG1pbiIsImF1dGhfdGltZSI6MTQ4OTc4NzAxNiwicmV2X3NpZyI6IjFlYTlmMTkyIiwiaWF0IjoxNDg5Nzg3MDE2LCJleHAiOjE0ODk3ODc2MTYsImlzcyI6Imh0dHBzOi8vdWFhLmxvY2FsMi5wY2ZkZXYuaW8vb2F1dGgvdG9rZW4iLCJ6aWQiOiJ1YWEiLCJhdWQiOlsic2NpbSIsImNsb3VkX2NvbnRyb2xsZXIiLCJwYXNzd29yZCIsImNmIiwidWFhIiwib3BlbmlkIiwiZG9wcGxlciIsInJvdXRpbmcucm91dGVyX2dyb3VwcyJdfQ.vgf2YtgKBwrg77w_h-Snld1udZnJr9J8xR_d_rWcyUMXSHeL7-Ekh4phqaf48-8uNeTknjogd47bPYb8fnE3k6wHyyK41tA7MbHgkkzcabdHaLG_dfqXbPgqnG0PE_kltYhMvqbWsf1hDcD7BkECudLSpPBQ7k1HLd1DZtHyq28
[cloudfoundry-client-nio-1] DEBUG cloudfoundry-client.token - Access Token Issued At:  2017-03-17T21:43:36 UTC
[cloudfoundry-client-nio-1] DEBUG cloudfoundry-client.token - Access Token Expires At: 2017-03-17T21:53:36 UTC
[cloudfoundry-client-nio-5] DEBUG cloudfoundry-client.response - 200    https://api.local2.pcfdev.io:443/v2/organizations?q=name%20IN%20my,org&page=1 (435 ms)
Exception in thread "main" java.lang.IllegalArgumentException: Organization my,org does not exist
	at org.cloudfoundry.util.ExceptionUtils.illegalArgument(ExceptionUtils.java:45)
	at org.cloudfoundry.operations._DefaultCloudFoundryOperations.lambda$getOrganization$1(_DefaultCloudFoundryOperations.java:240)
	at reactor.core.publisher.Mono.lambda$otherwise$21(Mono.java:2206)
	at reactor.core.publisher.FluxResume$ResumeSubscriber.onError(FluxResume.java:88)
	at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:156)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:710)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:482)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:462)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:455)
	at reactor.core.publisher.MonoFlatMap$FlattenSubscriber$InnerSubscriber.onComplete(MonoFlatMap.java:209)
	at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drainAsync(FluxFlattenIterable.java:291)
	at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drain(FluxFlattenIterable.java:590)
	at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.onComplete(FluxFlattenIterable.java:232)
	at reactor.core.publisher.FluxBuffer$BufferExactSubscriber.onComplete(FluxBuffer.java:184)
	at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onComplete(FluxConcatArray.java:196)
	at reactor.core.publisher.FluxConcatArray.subscribe(FluxConcatArray.java:93)
	at reactor.core.publisher.FluxBuffer.subscribe(FluxBuffer.java:76)
	at reactor.core.publisher.FluxFlattenIterable.subscribe(FluxFlattenIterable.java:104)
	at reactor.core.publisher.MonoFlatMap$FlattenSubscriber.onNext(MonoFlatMap.java:161)
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:370)
	at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:165)
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:78)
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
	at reactor.core.publisher.MonoFlatMap$FlattenSubscriber$InnerSubscriber.onNext(MonoFlatMap.java:199)
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
	at reactor.ipc.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:204)
	at reactor.ipc.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:319)
	at reactor.ipc.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:312)
	at reactor.ipc.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:574)
	at reactor.ipc.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:125)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
	at reactor.ipc.netty.http.HttpOperations.lambda$static$3(HttpOperations.java:239)
	at reactor.ipc.netty.ReactorNetty$ExtractorHandler.channelRead(ReactorNetty.java:320)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1228)
	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1039)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
	at java.lang.Thread.run(Thread.java:745)
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Assembly trace from producer [reactor.core.publisher.FluxMap] :
	reactor.core.publisher.Flux.checkpoint(Flux.java:2473)
	org.cloudfoundry.operations.spaces.DefaultSpaces.list(DefaultSpaces.java:185)
	com.github.kdvolder.cfv2sample.CFV2SampleMain.listSpaces(CFV2SampleMain.java:136)
	com.github.kdvolder.cfv2sample.CFV2SampleMain.main(CFV2SampleMain.java:99)
Error has been observed by the following operator(s):
	|_	Flux.checkpoint(DefaultSpaces.java:185)

	Suppressed: java.lang.Exception: #block terminated with an error
		at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:93)
		at reactor.core.publisher.Mono.block(Mono.java:1189)
		at com.github.kdvolder.cfv2sample.CFV2SampleMain.listSpaces(CFV2SampleMain.java:138)
		at com.github.kdvolder.cfv2sample.CFV2SampleMain.main(CFV2SampleMain.java:99)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions