Open gayatri-kulkarni1 opened 3 years ago
I've added 5da8147 so that we can get more information on the response. Would you mind rerunning again and get the new output?
I have rebuilt the copybara jar and re-run the command. Here is the new output -
Dec 01, 2020 12:14:56 PM com.google.copybara.Main configureLog
INFO: Setting up LogManager
[34mC[0m[31mo[0m[33mp[0m[34my[0m[32mb[0m[31ma[0m[34mr[0m[31ma[0m source mover (Version: Unknown version)
[32mTask: [0mCleaning output directory
[1A[2K[32mTask: [0mRunning migrate
[1A[2K[32mTask: [0mLoading config copy.bara.sky
[33mWARN: [0m'ref' field detected in configuration. git.gerrit_origin is deprecating its usage for submitted changes. Use git.origin instead.
[32mTask: [0mValidating configuration
[1A[2K[32mTask: [0mGetting last revision: Resolving origin reference
[1A[2K[32mTask: [0mGit Origin: Initializing local repo
[1A[2K[32mTask: [0mGit Destination: Fetching: refs/heads/
[1A[2K[32mTask: [0mCleaning working directory
[1A[2K[32mTask: [0mChecking out the change
[1A[2K[32mTask: [0mRemoving excluded origin files
[1A[2K[32mTask: [0mChecking that destination_files covers all files in transform result
[1A[2K[32mTask: [0mGit Destination: Checking out
[1A[2K[32mTask: [0mGit Destination: Adding all files
[1A[2K[32mTask: [0mGit Destination: Excluding files
[1A[2K[32mTask: [0mGit Destination: Creating a local commit
[1A[2K[32mTask: [0mQuerying Gerrit ('') for active changes with hashtag 'copybara_id2299CE23BC2B96B99CEC9CC04BD6B7BE'
java.lang.IllegalArgumentException:
at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:889)
at com.google.api.client.json.JsonParser.parse(JsonParser.java:382)
at com.google.api.client.json.JsonParser.parse(JsonParser.java:355)
at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:87)
at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:488)
at com.google.copybara.git.gerritapi.GerritApiTransportImpl.execute(GerritApiTransportImpl.java:112)
at com.google.copybara.git.gerritapi.GerritApiTransportImpl.get(GerritApiTransportImpl.java:66)
at com.google.copybara.git.gerritapi.GerritApi.getChanges(GerritApi.java:47)
at com.google.copybara.git.GerritDestination$GerritWriteHook.findActiveChange(GerritDestination.java:230)
at com.google.copybara.git.GerritDestination$GerritWriteHook.generateMessageInfo(GerritDestination.java:178)
at com.google.copybara.git.GitDestination$WriterImpl.write(GitDestination.java:504)
at com.google.copybara.WorkflowRunHelper$ChangeMigrator.doMigrate(WorkflowRunHelper.java:703)
at com.google.copybara.WorkflowRunHelper$ChangeMigrator.migrate(WorkflowRunHelper.java:402)
at com.google.copybara.WorkflowMode$1.run(WorkflowMode.java:117)
at com.google.copybara.Workflow.run(Workflow.java:279)
at com.google.copybara.MigrateCmd.run(MigrateCmd.java:82)
at com.google.copybara.MigrateCmd.run(MigrateCmd.java:60)
at com.google.copybara.Main.runInternal(Main.java:244)
at com.google.copybara.Main.run(Main.java:122)
at com.google.copybara.Main.main(Main.java:101)
Caused by: java.lang.IllegalArgumentException: expected primitive class, but got: java.util.List
Config used:
core.workflow(
name = "default",
origin = git.gerrit_origin(
url = "<
Could you also suggest the correct configuration to be used to achieve this requirement?
Based on the stacktrace, it looks like you run with the same code version:
parseValue(JsonParser.java:889)
Regarding to:
is it possible to migrate pending open change from source gerrit server to destination gerrit?
Yes, it should be possible.
Based on the stacktrace, it looks like you run with the same code version:
parseValue(JsonParser.java:889)
ohh okay. Please check the new output here:
WARN: 'ref' field detected in configuration. git.gerrit_origin is deprecating its usage for submitted changes. Use git.origin instead.
Task: Querying Gerrit ('<
Regarding to:
is it possible to migrate pending open change from source gerrit server to destination gerrit?
Yes, it should be possible.
Could you please provide the correct configuration that can be used to do so. Please check the config I am using.
CAUSED BY: stream is closed
That seems like a different error. The original one was parsing the response. This one is about the stream being closed while receiving the response.
Regarding to:
'ref' field detected in configuration. git.gerrit_origin is deprecating its usage for submitted changes. Use git.origin instead.
git.gerrit_origin is mean to be used for migrating presubmit changes (to test them, accept changes in the other side, etc.). If you want to migrate submitted changes (Even if are coming from gerrit), use git.origin.
If you want to migrate pending changes only from specific branches, use branch
field instead of ref
.
I am trying to migrate pending change from source to destination, not getting why is it querying for destination url for the pending/active changes?
Querying Gerrit ('<>') for active changes with hashtag 'copybara_idEA44847DE6FA9C4FF4B81D0E1B7D68BB' ERROR: Error running Gerrit API operation https://*/changes/?q=hashtag:%22copybara_id_EA44847DE6FA9C4FF4B81D0E1B7D68BB_%22%20AND%20project:.git%20AND%20status:NEW
We look for existing changes in the destination to reuse the same destination change for the same origin change. In order to achieve that we use Gerrit hashtag.
As the change is new for destination (its a pending change from source), it won't match any change in destination and hence not able to migrate it.
What is the solution to migrate such open pending changes to destination without this issue.
Hi, I was able to submit the pending change from source to destination, But my requirement is not to submit but create pending change in destination. How can I do it?
Getting below error : [1A[2K[32mTask: [0m**Querying Gerrit ('***') for active changes with hashtag 'copybara_id2299CE23BC2B96B99CEC9CC04BD6B7BE' java.lang.IllegalArgumentException: at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:889) at com.google.api.client.json.JsonParser.parse(JsonParser.java:382) at com.google.api.client.json.JsonParser.parse(JsonParser.java:355) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:87) at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:488) at com.google.copybara.git.gerritapi.GerritApiTransportImpl.execute(GerritApiTransportImpl.java:112) at com.google.copybara.git.gerritapi.GerritApiTransportImpl.get(GerritApiTransportImpl.java:66) at com.google.copybara.git.gerritapi.GerritApi.getChanges(GerritApi.java:47) at com.google.copybara.git.GerritDestination$GerritWriteHook.findActiveChange(GerritDestination.java:230) at com.google.copybara.git.GerritDestination$GerritWriteHook.generateMessageInfo(GerritDestination.java:178) at com.google.copybara.git.GitDestination$WriterImpl.write(GitDestination.java:504) at com.google.copybara.WorkflowRunHelper$ChangeMigrator.doMigrate(WorkflowRunHelper.java:703) at com.google.copybara.WorkflowRunHelper$ChangeMigrator.migrate(WorkflowRunHelper.java:402) at com.google.copybara.WorkflowMode$2.run(WorkflowMode.java:176) at com.google.copybara.Workflow.run(Workflow.java:279) at com.google.copybara.MigrateCmd.run(MigrateCmd.java:82) at com.google.copybara.MigrateCmd.run(MigrateCmd.java:60) at com.google.copybara.Main.runInternal(Main.java:244) at com.google.copybara.Main.run(Main.java:122) at com.google.copybara.Main.main(Main.java:101) Caused by: java.lang.IllegalArgumentException: expected primitive class, but got: java.util.List
at com.google.api.client.util.Data.parsePrimitiveValue(Data.java:457)
at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:859)
... 19 more
[31mERROR: [0mUnexpected error (please file a bug against copybara): (java.lang.IllegalArgumentException: )
Could someone please help.