createProject via .Net.WebRequest, vcssettings ignored(project not intialzed) or fails parsing(Cannot deserialize params)

Good Day...
We would like to use windows forms et. al. (via .Net.WebRequests) to create projects so that our team leaders can just launch the form, create projects without logging in etc, since it is all in the app settings, encrypted etc..

Specifics
Upsource version: upsource-2017.2.2197
version.properties, bundle.build.number=1.3.275

Having no problems with other RPC service calls, just createProject...
Authentication is all set, and getCurrentUser returns correct admin user(as set in the web headers), so...setting username, password, fields of CreateProjectRequestDTO and ProjectSettingsDTO are all correctly set (I believe).

- In one scenario, the project is created, but initialization has failed, most likely due to me placing the vcsSettings incorrectly (outside settings, therefore being ingored, yet passes parsing).
- The other scenario, where I put the vcsSettings as a field of settings(As per documentation), is failing parsing.

Scenario pass parsing but project not initialized: url sent
http://my_server:8081/~rpc/createProject?params={"newProjectId":"outsidesettins","settings":{"projectName":"outsidesettins","checkIntervalSeconds":602,"projectModel":{"type":"none","pathToModel":""},"codeReviewIdPattern":"DD-CR-{}","runInspections":true,"mavenSettings":"","mavenProfiles":"","modelConversionSystemProperties":"","gradleProperties":"","gradleInitScript":"","createUserGroups":true,"defaultEncoding":"","defaultBranch":"trunk","skipFileContentsImport":["*.bin","*.dll","*.exe","*.so"],"javascriptLanguageLevel":"ES6","buildStatusReceiveToken":"","authorCanCloseReview":true,"authorCanDeleteReview":true,"limitResolveDiscussion":true},"vcsSettings":{"mappings":[{"id":"id","vcs":"svn","url":"https://svn/blahblah/analog","username":"userClearText","password":"pwClearText"}]}}

from upsource-frontend\all.log
[2017-08-17 14:30:55,062] INFO Netty worker group-1 .rpc.endPoints.TaskManagerImpl - RPC: [Queued: 1] createProject:{"newProjectId":"outsidesettins","settings":{"projectName":"outsidesettins","checkIntervalSeconds":602,"projectModel":{"type":"none","pathToModel":""},"codeReviewIdPattern":"DD-CR-{}","runInspections":true,"mavenSettings":"","mavenProfiles":"","modelConversionSystemProperties":"","gradleProperties":"","gradleInitScript":"","createUserGroups":true,"defaultEncoding":"","defaultBranch":"trunk","skipFileContentsImport":["*.bin","*.dll","*.exe","*.so"],"javascriptLanguageLevel":"ES6","buildStatusReceiveToken":"","authorCanCloseReview":true,"authorCanDeleteReview":true,"limitResolveDiscussion":true}}, Users:{admin}
[2017-08-17 14:30:55,590] INFO se server executor-5 si.broker.DatabaseTaskRunnable - Executing db command: getProjectConfiguration:{"projectId":"outsidesettins"}
[2017-08-17 14:30:55,594] INFO RPC task executor-6 ojectModificationsNotifierImpl - Creating project outsidesettins: Successfully finished. Do not restart Upsource while the project is initializing.
[2017-08-17 14:30:59,968] INFO jects-indexer-sync-1 i.global.MonitorActiveProjects - Detected ProjectContext{outsidesettins, uuid: 29}
[2017-08-17 14:30:59,984] INFO lyzer:INIT_CLUSTER-2 outsidesettins i.global.MonitorActiveProjects - Project 'outsidesettins' changed: ProjectStateRecord{Uuid=29, Status=Started}
[2017-08-17 14:30:59,984] INFO lyzer:INIT_CLUSTER-2 outsidesettins driver.InitGlobalDriverWrapper - Finished: 'init-start' for project 'outsidesettins' in 3ms
[2017-08-17 14:30:59,985] ERROR lyzer:INIT_CLUSTER-2 outsidesettins ti.init.InitCommitsGraphDriver - Failed to connect to VCS. Project will not be initialized. Restart Analyzer to try again. VCS problem in outsidesettins. Project has no VCS mappings. It should have at least one
java.lang.Error: VCS problem in outsidesettins. Project has no VCS mappings. It should have at least one
at com.jetbrains.upsource.backend.cli.vcs.service.TestConnectionController.test(TestConnectionController.java:54)
at com.jetbrains.upsource.backend.cli.vcs.service.TestConnectionController$1.testConnection(TestConnectionController.java:41)
at com.jetbrains.upsource.backend.cli.vcs.TestConnectionService.testConnection(TestConnectionService.java:25)
at com.jetbrains.upsource.backend.cli.multi.init.InitCommitsGraphDriver.analyze(InitCommitsGraphDriver.java:71)
at com.jetbrains.upsource.backend.cli.stages.driver.InitGlobalDriverWrapper.analyze(InitGlobalDriverWrapper.java:41)
at com.jetbrains.upsource.backend.cli.multi.init.InitPipeline.a(InitPipeline.java:73)
at __. project_outsidesettins .__.run(JavaGeneratorTemplate.java:43)
at com.jetbrains.upsource.common.NamedFrameUtil.withProject(NamedFrameUtil.java:21)
at com.jetbrains.upsource.backend.cli.multi.tasks.MultiProjectTaskFactory$TaskExecutor.executeTask(MultiProjectTaskFactory.java:170)
at com.jetbrains.upsource.backend.cli.multi.tasks.MultiProjectTaskFactory$TaskExecutor$1.run(MultiProjectTaskFactory.java:153)
at com.jetbrains.upsource.backend.cli.multi.executor.ProjectSyncExecutor$ProjectTasks$1$1.run(ProjectSyncExecutor.java:199)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at com.jetbrains.upsource.util.NamedDaemonThreadFactory.a(NamedDaemonThreadFactory.java:34)
at java.lang.Thread.run(Thread.java:748)
[2017-08-17 14:30:59,986] INFO lyzer:INIT_CLUSTER-2 outsidesettins driver.InitGlobalDriverWrapper - Stopped project analyze! : 'init-commits-graph' (project: outsidesettins) in 1ms
[2017-08-17 14:30:59,987] INFO lyzer:INIT_CLUSTER-2 outsidesettins i.global.MonitorActiveProjects - Project 'outsidesettins' changed: ProjectStateRecord{Uuid=29, Status=Failed}
[2017-08-17 14:30:59,987] WARN lyzer:INIT_CLUSTER-2 outsidesettins nd.cli.multi.init.InitPipeline - Failed to complete project initialization tasks. Will NOT process the project.
====================================================================================

====================================================================================

Scenario vcsSettings fails parsing, no project created. url sent
http://my_Server:8081/~rpc/createProject?params={"newProjectId":"subsettings","settings":{"projectName":"subsettings","checkIntervalSeconds":601,"projectModel":{"type":"none","pathToModel":""},"codeReviewIdPattern":"DD-CR-{}","runInspections":true,"mavenSettings":"","mavenProfiles":"","modelConversionSystemProperties":"","gradleProperties":"","gradleInitScript":"","createUserGroups":true,"defaultEncoding":"","defaultBranch":"trunk","skipFileContentsImport":["*.bin","*.dll","*.exe","*.so"],"javascriptLanguageLevel":"ES6","buildStatusReceiveToken":"","authorCanCloseReview":true,"authorCanDeleteReview":true,"limitResolveDiscussion":true,"vcsSettings":{"mappings":[{"id":"id","vcs":"svn","url":"https://svn/blahblah/analog","username":"userClearText","password":"pwClearText"}]}}}

from upsource-frontend\all.log
[2017-08-17 14:30:38,774] INFO Netty worker group-1 .serializers.RpcDecoderEncoder - Cannot decode request from X-Forwarded-For:fe80:0:0:0:951f:594f:d4ac:41c1%9: /~rpc/createProject?params=%7B%22newProjectId%22:%22subsettings%22,%22settings%22:%7B%22projectName%22:%22subsettings%22,%22checkIntervalSeconds%22:601,%22projectModel%22:%7B%22type%22:%22none%22,%22pathToModel%22:%22%22%7D,%22codeReviewIdPattern%22:%22DD-CR-%7B%7D%22,%22runInspections%22:true,%22mavenSettings%22:%22%22,%22mavenProfiles%22:%22%22,%22modelConversionSystemProperties%22:%22%22,%22gradleProperties%22:%22%22,%22gradleInitScript%22:%22%22,%22createUserGroups%22:true,%22defaultEncoding%22:%22%22,%22defaultBranch%22:%22trunk%22,%22skipFileContentsImport%22:[%22*.bin%22,%22*.dll%22,%22*.exe%22,%22*.so%22],%22javascriptLanguageLevel%22:%22ES6%22,%22buildStatusReceiveToken%22:%22%22,%22authorCanCloseReview%22:true,%22authorCanDeleteReview%22:true,%22limitResolveDiscussion%22:true,%22vcsSettings%22:%7B%22mappings%22:[%7B%22id%22:%22id%22,%22vcs%22:%22svn%22,%22url%22:%22https://svn/svn/svn.datastart/analog%22,%22username%22:%22userClearText%22,%22password%22:%22pwClearText22%7D]%7D%7D%7D
com.jetbrains.upsource.netty.serializers.RpcDecoderException: Cannot deserialize params. Method: 'createProject', params: '{"newProjectId":"subsettings","settings":{"projectName":"subsettings","checkIntervalSeconds":601,"projectModel":{"type":"none","pathToModel":""},"codeReviewIdPattern":"DD-CR-{}","runInspections":true,"mavenSettings":"","mavenProfiles":"","modelConversionSystemProperties":"","gradleProperties":"","gradleInitScript":"","createUserGroups":true,"defaultEncoding":"","defaultBranch":"trunk","skipFileContentsImport":["*.bin","*.dll","*.exe","*.so"],"javascriptLanguageLevel":"ES6","buildStatusReceiveToken":"","authorCanCloseReview":true,"authorCanDeleteReview":true,"limitResolveDiscussion":true,"vcsSettings":{"mappings":[{"id":"id","vcs":"svn","url":"https://svn/blahblah/analog","username":"userClearText","password":"pwClearText"}]}}}'
at com.jetbrains.upsource.netty.serializers.RpcDecoderEncoder.parse(RpcDecoderEncoder.java:108)
at com.jetbrains.upsource.frontend.server.handlers.rpc.HttpRpcHandler.process(HttpRpcHandler.java:52)
at com.jetbrains.upsource.netty.handlers.WebRequestsRouterHandler.channelRead0(WebRequestsRouterHandler.java:95)
at com.jetbrains.upsource.netty.handlers.WebRequestsRouterHandler.channelRead0(WebRequestsRouterHandler.java:20)
at com.jetbrains.upsource.netty.handlers.SimpleChannelInboundHandlerEx.channelRead(SimpleChannelInboundHandlerEx.java:71)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at com.corundumstudio.socketio.handler.AuthorizeHandler.channelRead(AuthorizeHandler.java:134)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at com.jetbrains.upsource.netty.handlers.SimpleChannelInboundHandlerEx.channelRead(SimpleChannelInboundHandlerEx.java:73)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at com.jetbrains.upsource.netty.handlers.SimpleChannelInboundHandlerEx.channelRead(SimpleChannelInboundHandlerEx.java:77)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:934)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at com.jetbrains.upsource.util.NamedDaemonThreadFactory.a(NamedDaemonThreadFactory.java:34)
at java.lang.Thread.run(Thread.java:748)
Caused by: io.protostuff.JsonInputException: Expected token: string but was START_OBJECT
at io.protostuff.JsonInput.readString(JsonInput.java:367)
at com.jetbrains.upsource.frontend.server.rpc.generated.ProjectSettingsDTO.mergeFrom(ProjectSettingsDTO.java:776)
at com.jetbrains.upsource.frontend.server.rpc.generated.ProjectSettingsDTO.mergeFrom(ProjectSettingsDTO.java:21)
at io.protostuff.JsonInput.mergeObject(JsonInput.java:427)
at com.jetbrains.upsource.frontend.server.rpc.generated.CreateProjectRequestDTO.mergeFrom(CreateProjectRequestDTO.java:141)
at com.jetbrains.upsource.frontend.server.rpc.generated.CreateProjectRequestDTO.mergeFrom(CreateProjectRequestDTO.java:21)
at io.protostuff.JsonIOUtil.mergeFrom(JsonIOUtil.java:337)
at io.protostuff.JsonIOUtil.mergeFrom(JsonIOUtil.java:316)
at com.jetbrains.upsource.netty.serializers.RpcDecoderEncoder.parse(RpcDecoderEncoder.java:106)
... 54 more

====================================================================================

====================================================================================


Pretty sure I am missing something damn obvious...any help would be greatly appreciated.

Miklos.

1 comment
Comment actions Permalink

Hi Miklos,

Sorry for the delay.

Try the following format for vcsSettings:

"vcsSettings":
"{\"mappings\":[{\"vcs\":\"svn\",\"url\":\"http://svn.......\",\"login\":\",my_login\",\"password\":\"my_passowrd\",\"mapping\":\"\",\"client\":\"\",\"svnBranches\":\"+:trunk\\\\n+:branches/*\", \"mapping\":\"/\", \"id\":\"\"}]}\"}},\"id\":\"\"}]}"

0

Please sign in to leave a comment.