Command Line Remote Run Tool fails with "filename " has not accosiated ITCResource(null) or empty RepositoryPath(null)

Hi,

I'm trying to use Command Line Remote Run Tool to trigger a remote run and after getting its return value to submit to perforce if the remote run succeeds.

I'm using TeamCity  Professional Version 6.5.4  (build 18046) and the latest release of Perforce.

The remote run tool fails when I call it (more info in a sec).

The root of my project for perforce is in: D:\TestRoot\

I have a .teamcity-mappings.properties file in D:\TestRoot (and one in D:\.TeamCity-CommandLine\ for good measure)

The contents of the properties file have been generated by TeamCity as such:

buildDebug=perforce://PERFORCESERVERNAME:1666:////depotname/main


I have 1 file in my perforce changelist, it's called D:\TestRoot\testfile.txt

When i try to call a remote run I get this:

D:\TestRoot>java -jar tcc.jar run --host "http://eval:8011" -c bt3 -m "MyTest" D:\TestRoot\testfile.txt
[Connecting to "http://eval:8011" TeamCity Server] started
[Connecting to "http://eval:8011" TeamCity Server] done
[Checking compatibility] started
[Checking compatibility] done
[Logging in] started
[Logging in] done
[Collecting changes] started
[Collecting changes] Collected 1 files for Remote Run
[Collecting changes] done
[Mapping local files to TeamCity] started
[Mapping local files to TeamCity] run: error
Invalid parameter(s): No one of 1 file(s) has been mapped to TeamCity.
Perhaps resources were collected for Remote Run are not covered by TeamCity mappings. Check your '.teamcity-mappings.properties' file(s).

Start personal build
usage: run <option> [<option>...] FILE [FILE...]|@FILELIST


Starts Remote Run for the files specified by FILE arguments in TeamCity Configuration specified by <cfg> argument.
FILE can be a file or a directory. When directory is specified, its entire content is used (including nested).
If FILELIST is set to a file path, the file's content is interpreted as individual file names list.
NOTE: a file which is specified but is not found on the filesystem will be treated as deleted for Remote Run.


Valid options:
        -c[--configuration]     <cfg>[,<cfg1>...]       target TeamCity configuration id(s) for the Remote Run
        -m[--message]           <message>               users message describes changes for Remote Run.
        -t[--timeout]           <timeout>               max time the utility will wait for Remote Run result if -n|--nowait switch is missing
        -n              <mapping_file>          overrides Default TeamCity mappings.
        --nowait[-c}]                                   do not wait for build result, just schedule build for execution



Looking at the log I can see some further info about

2012-02-15 10:48:42,982 DEBUG [main] com.jetbrains.teamcity.Server     - XmlRpc session http://eval:8011 created. Timeout set to 600000
2012-02-15 10:48:43,078 DEBUG [main] com.jetbrains.teamcity.command.CommandRunner     - Checking protocol compatibility. Found local=6.5.0.10, remote=6.5.0.10
2012-02-15 10:48:43,128 DEBUG [main] com.jetbrains.teamcity.resources.TCWorkspace     - Check Default location "D:\/.TeamCity-CommandLine\.teamcity-mappings.properties" for Admin file
2012-02-15 10:48:43,138 DEBUG [main] com.jetbrains.teamcity.resources.TCWorkspace     - Overriding Matcher set to "null"
2012-02-15 10:48:43,140 DEBUG [main] com.jetbrains.teamcity.command.RemoteRun     - Read from arguments: [D:\TestRoot\testfile.txt]
2012-02-15 10:48:43,143 DEBUG [main] com.jetbrains.teamcity.command.RemoteRun     - D:\TestRoot\testfile.txt
2012-02-15 10:48:43,144 DEBUG [main] com.jetbrains.teamcity.resources.TCWorkspace     - found mapping for D:\Work\Epoch\h1 in D:\TestRoot\.teamcity-mappings.properties
2012-02-15 10:48:43,145 DEBUG [main] com.jetbrains.teamcity.resources.TCWorkspace     - No Matching found for " D:\TestRoot\testfile.txt "
2012-02-15 10:48:43,145 DEBUG [main] com.jetbrains.teamcity.command.RemoteRun     - ? " D:\TestRoot\testfile.txt " has not accosiated ITCResource(null) or empty RepositoryPath(null)
2012-02-15 10:48:43,146 DEBUG [main] com.jetbrains.teamcity.command.CommandRunner     - No one of 1 file(s) has been mapped to TeamCity.
Perhaps resources were collected for Remote Run are not covered by TeamCity mappings. Check your '.teamcity-mappings.properties' file(s).
java.lang.IllegalArgumentException: No one of 1 file(s) has been mapped to TeamCity.
Perhaps resources were collected for Remote Run are not covered by TeamCity mappings. Check your '.teamcity-mappings.properties' file(s).
 at com.jetbrains.teamcity.command.RemoteRun.getTCResources(RemoteRun.java:207)
 at com.jetbrains.teamcity.command.RemoteRun.execute(RemoteRun.java:165)
 at com.jetbrains.teamcity.command.CommandRunner.run(CommandRunner.java:113)
 at com.jetbrains.teamcity.command.CommandRunner.main(CommandRunner.java:133)


I've tried to do a remote run from the visual studio addin, and that works just fine, so there must be something wrong in my setup for the command line remote run tool.

Does anybody know what could be going wrong? Any help appreciated.

Cheers,

Simona
16 comments
Comment actions Permalink

Rule:
buildDebug=perforce://PERFORCESERVERNAME:1666:////depotname/main

Means that any change under <project root>/buildDebug must be mapped to specified path in Perforce.

But you did not change file under buildDebug directory (there is no buildDebug in the path to changed file), so the tool does not know how to map this file.

0
Comment actions Permalink

Hi Pavel,

thank you very much for your reply.
I had completely misunderstood this, thanks!

I have now changed the line to read like this in the properties:
main=perforce://PERFORCESERVERNAME:1666:////depotname/main

It seems to get further, but still doesn't work.

Let's say my file is here: D:\TestRoot\foo\sometestfile.txt

The new error says:

RemoteRun: D:\TestRoot\foo\sometestfile.txt


[Mapping local files to TeamCity] started
TCWorkspace: found mapping for D:\TestRoot\foo in D:\TestRoot\.teamcity-mappings.properties
TCWorkspace: No Matching found for "D:\TestRoot\foo\sometestfile.txt "



And the rest is exactly the same as before.

If I do this with a file in the root folder I get this:

TCWorkspace: found mapping for D:\TestRoot\rootFile.txt in D:\TestRoot\.teamcity-mappings.properties
TCWorkspace: No Matching found for "D:\TestRoot\rootFile.txt"



Any suggestions for this?

What's the difference between a mapping and a match for it?

Cheers,

Simona
0
Comment actions Permalink

BTW, I would recommend to update your tool to this version: http://teamcity.jetbrains.com/viewLog.html?buildId=59803&tab=artifacts&buildTypeId=bt314
It has slightly better error handling.

0
Comment actions Permalink

The problem seems to be the same. Now your rule is:
main=perforce://PERFORCESERVERNAME:1666:////depotname/main

Left part of the rule (main) tells the tool that any file under main directory must be prefixed with perforce://PERFORCESERVERNAME:1666:////depotname/main.
But, as in previous attempt you do not modify file under main, so again, the tool does not know how to map the file, which prefix to use.

If files under D:\TestRoot map to perforce://PERFORCESERVERNAME:1666:////depotname/main, you should have rule like:
.=perforce://PERFORCESERVERNAME:1666:////depotname/main

0
Comment actions Permalink

I get this when I run it:

D:\TestRoot\server>java -jar command.line.jar help
Exception in thread "main" java.lang.NullPointerException
        at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:399)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463)


:(
0
Comment actions Permalink

command.line.jar is a server side plugin and is not meant to be used from command line. Instead it must be placed under .BuildServer/plugins directory. If you restart your server with updated command.line.jar plugin you'll be able to download tcc.jar from your user profile. Or, you can extract it from the command.line.jar archive.

0
Comment actions Permalink

Ah, totally, I can't do that until next week, but I'll give it a try, thanks!

0
Comment actions Permalink

This fixed it all, thank you so much!

0
Comment actions Permalink

Is there a specific reason why users have to download the tool from TeamCity?

Could we distribute it with the rest of our source code (so, put a copy of the downloaded tool in Perforce)?

Cheers,

Simona

0
Comment actions Permalink

No, there is no any specific reason. Yes, you can put it under Version control. I plan to publish separate tcc.jar artifact to simplify plugin update for such cases.

0
Comment actions Permalink

After having this working happily with our perforce test instance, I'm now trying to make it work on our development instance.

It should be pretty much the same, but after I tweaked the script it's now failing in some new way:

[Collecting configurations for running] started
RemoteRun: All applicable configurations: []
RemoteRun: Requested configurations for runing: [bt15]
RemoteRun: Use configurations for runing: []
[Collecting configurations for running] run: error
CommandRunner: No one of [bt15] configurations affected by collected changes
java.lang.IllegalArgumentException: No one of [bt15] configurations affected by collected changes
        at com.jetbrains.teamcity.command.RemoteRun.execute(RemoteRun.java:173)
        at com.jetbrains.teamcity.command.CommandRunner.run(CommandRunner.java:113)
        at com.jetbrains.teamcity.command.CommandRunner.main(CommandRunner.java:133)
Invalid parameter(s): No one of [bt15] configurations affected by collected changes



The output for the working instance shows this instead:

[Collecting configurations for running] started
RemoteRun: All applicable configurations: [bt10, bt3, bt4, bt12, bt11, bt9]
RemoteRun: Requested configurations for runing: [bt3]
RemoteRun: Use configurations for runing: [bt3]
[Sending the patch to TeamCity Server] started
[Sending the patch to TeamCity Server] sent 322 bytes
[Sending the patch to TeamCity Server] done
RemoteRun: Created build request for "bt3" configuration of changeId=2, checkForChangesEarly=false
[Scheduling personal build] started
RemoteRun: Remote Run scheduled successfull.
[Scheduling personal build] done
RemoteRun: Falling asleep for [3000] millis...
[Waiting for personal build] started
Running................................................................Build was successful
[Waiting for personal build] done
Build for Change #2 ran successfully



It looks like it's not finding any configs for the new project, although if I do this, the displayed configs are correct:

D:\DevRoot>java -jar tcc.jar info --host "http://eval:8011" -p project5
[Connecting to "http://eval :8011" TeamCity Server] started
[Connecting to "http://eval :8011" TeamCity Server] done
[Checking compatibility] started
[Checking compatibility] done
[Logging in] started
[Logging in] done
id   project name                  status  description
bt15 dev   Build Runtime Debug   NORMAL  <empty>
bt16 dev   Build Runtime Final   NORMAL  <empty>
bt17 dev   Build Runtime Release NORMAL  <empty>



I can do a remote run from the visual studio addin, so it's probably again something in my setup.

Cheers,

Simona
0
Comment actions Permalink

For some reason TeamCity server thinks that build configuration bt15 won't be affected by your changes. This usually means that patch cannot be applied to sources checked out by this build configuration. To be more precise I need to know what is in your mapping file and what are the settings of VCS roots in bt15 build configuration.

0
Comment actions Permalink

Hi Pavel,

I thought that as well at the start, but now I think the Tool is not seeing ANY configurations available for that project I am trying to use.

In the project that works, if I input an incorrect configuration, I get this:

RemoteRun: All applicable configurations: [bt10, bt3, bt4, bt12, bt11, bt9]
RemoteRun: Requested configurations for runing: [bt3111]
RemoteRun: Use configurations for runing: []
[Collecting configurations for running] run: error
CommandRunner: No one of [bt3111] configurations affected by collected changes
java.lang.IllegalArgumentException: No one of [bt3111] configurations affected by collected changes
at com.jetbrains.teamcity.command.RemoteRun.execute(RemoteRun.java:173)
at com.jetbrains.teamcity.command.CommandRunner.run(CommandRunner.java:113)
at com.jetbrains.teamcity.command.CommandRunner.main(CommandRunner.java:133)
Invalid parameter(s): No one of [bt3111] configurations affected by collected changes



In green you can see that remote run finds six configs, and then tries to match the incorrect one and fails.

In the project that doesn't work, NO configurations are found

RemoteRun: All applicable configurations: []
RemoteRun: Requested configurations for runing: [bt15]
RemoteRun: Use configurations for runing: []
[Collecting configurations for running] run: error
CommandRunner: No one of [bt15] configurations affected by collected changes
java.lang.IllegalArgumentException: No one of [bt15] configurations affected by collected changes
        at com.jetbrains.teamcity.command.RemoteRun.execute(RemoteRun.java:173)
        at com.jetbrains.teamcity.command.CommandRunner.run(CommandRunner.java:113)
        at com.jetbrains.teamcity.command.CommandRunner.main(CommandRunner.java:133)
Invalid parameter(s): No one of [bt15] configurations affected by collected changes



I suspect the error that's displayed is spurious due to the fact no configurations are found.

Any ideas why this would happen? I've been trying to use the source code for the tool, but I've never used Java before so it will take me a while to understand how to debug it, etc.

Cheers,

Simona
0
Comment actions Permalink

A combination of the new tcc.jar plugin and some fiddling with the setup of the Team City project has fixed this, all is working now! :)

Thank you very much!

Simona

0
Comment actions Permalink

Hi Pavel,

Nedd help in setting the .teamcity-mappings.properties i have my files modified under C:\depotname\main and i confgiured my vcs path in  .prop file as C:\depotname\main=perforce://PERFORCESERVERNAME:6661:////depotname/main still i couldnt get TC command line working for me it fails sauing

[Logging in] started
[Logging in] done
[Collecting changes] started
[Collecting changes] Collected 62 files for Remote Run
[Collecting changes] done
[Mapping local files to TeamCity] started
[Mapping local files to TeamCity] run: error
Invalid parameter(s): No one of 62 file(s) has been mapped to TeamCity.
Perhaps resources were collected for Remote Run are not covered by TeamCity mappings. Check your '.teamcity-mappings.properties' file(s) .



what is that i should correct here??
0
Comment actions Permalink

Hi Pavel,

Nedd help in setting the .teamcity-mappings.properties i have my files modified under C:\depotname\main and i confgiured my vcs path in  .prop file as C:\depotname\main=perforce://PERFORCESERVERNAME:6661:////depotname/main still i couldnt get TC command line working for me it fails sauing

[Logging in] started
[Logging in] done
[Collecting changes] started
[Collecting changes] Collected 62 files for Remote Run
[Collecting changes] done
[Mapping local files to TeamCity] started
[Mapping local files to TeamCity] run: error
Invalid parameter(s): No one of 62 file(s) has been mapped to TeamCity.
Perhaps resources were collected for Remote Run are not covered by TeamCity mappings. Check your '.teamcity-mappings.properties' file(s) .


what is that i should correct here??

0

Please sign in to leave a comment.