Jump to content

GitSync crash Null reference exception attempting pull from bitbucket


wnicholls

Recommended Posts

I've still got some work to try on this, but I'm going to document here because I think there has to be a bug in plastic, even if I can get around it.

Scenario:  repository exported via cm fast-export, then imported into a new repository hosted on bitbucket.  (I did not do the import);  Another developer made one small push (new changeset). Then in Plastic GUI, right click on branch - > Replication -> Sync with Git;  specified repository information and OK .   Went off like a rocket for a while, but stalled with 'an error occurred' message (sorry, didn't capture it).

plastic.debug.log.txt  shows lots of progress on the changsets that Plastic already had,

2018-05-02 12:18:22,675 ZORANEL\Walter INFO  sync - Changes to pull (Id:a69d209fc70af921224cc3779523ee970f230fb5 Comment:'Changeset: 1 Initial add of projects.....'):
2018-05-02 12:18:22,707 ZORANEL\Walter INFO  sync - Changes to pull (Id:4c60ecc214d65d7c96e633454f680b733934ef79 Comment:'Changeset: 2 ....'):
 (...  etc etc ... )
2018-05-02 12:19:41,019 ZORANEL\Walter INFO  sync - Changes to pull (Id:772e969055661fa7975709d23af20490d0b0c563 Comment:'Changeset: 190 .....

But then comes the new pull request, which consists of I think one new file.

2018-05-02 12:19:41,454 ZORANEL\Walter INFO  sync - Changes to pull (Id:fce5044ea6290667186af0aa11667a16e98e517f Comment:'added readme with walters notes outlining the project structure.
'):
2018-05-02 12:19:41,926 ZORANEL\Walter DEBUG PlasticProtocolConnectionCreator - Create connection to plastic.csl:8087 took 16 ms
2018-05-02 12:19:42,286 ZORANEL\Walter DEBUG PlasticPipe - CmCallContext sent to server on connection creation
2018-05-02 12:19:42,664 ZORANEL\Walter INFO  Serialization - MarkerExtendedInfoArray [12] deserialized in 0 ms.
2018-05-02 12:19:43,121 ZORANEL\Walter DEBUG PlasticPipe - sentb:   145|recb:  1177|prt:    1204|ExecuteSimpleQuery|plastic.csl:8087
2018-05-02 12:19:43,490 ZORANEL\Walter WARN  sync - Tag 'Pslab_0.9.14' was dicarded because it already exists in Plastic & Git applied to different changesets (136 - 5413705636ba463cfe769bda362b609f0650fff6)
2018-05-02 12:19:44,307 ZORANEL\Walter ERROR sync - Error running sync: Object reference not set to an instance of an object.. StackTrace:
   at mq.b(IList`1 A_0)
   at ki.a(List`1& A_0, List`1& A_1)
   at og.b(adk A_0, Boolean A_1)
   at og.a(Object A_0)
2018-05-02 12:19:46,910 ZORANEL\Walter ERROR plastic - Plastic SCM client version: 7.0.16.2095
2018-05-02 12:19:47,396 ZORANEL\Walter ERROR plastic -
Error message: Object reference not set to an instance of an object.
2018-05-02 12:19:47,833 ZORANEL\Walter DEBUG plastic -
StackTrace:    at mq.b(IList`1 A_0)
   at ki.a(List`1& A_0, List`1& A_1)
   at og.b(adk A_0, Boolean A_1)
   at og.a(Object A_0)
2018-05-02 12:20:14,726 ZORANEL\Walter DEBUG Channel - Purging connection to plastic.csl:8087

Crash message highlighted in bold.   (Also a small speling mistak in the warning message - should be 'discarded')

I have yet to try updating to latest plastic client release, or anything else for that matter. Urgent other problems are stacking up.

Any comment gratefully received - if I solve this I will post here.

 

Link to comment
Share on other sites

Hi @wnicholls,

I'm wondering if you had used a new Plastic SCM repository for the GitSync operation?

I'm asking you this because reusing an existing repository with content on it will end up in a bad result as the GitSync is not able to reconcile Plastic and Git objects that were created outside of the GitSync workflow (pulling/pushing).

Can you please confirm you are pulling for the first time, sing the GitSync operation, to a branch new Plastic SCM repository?

Which is the problem you are trying to resolve with the BitBucket repository? Maybe the Plastic SCM GitServer can solve it: https://www.plasticscm.com/gitserver/

 

 

Link to comment
Share on other sites

Well it did better than that , probably because the git repository was created from the plastic repo in the first place. However it did crash on the first non-plastic changeset.

I tried again to an empty plastic repo and it looks just fine although it sat for a very long time with the progress circle thing at "100% Downloading"  and the message "Receiving references..OK"  - the debug log was showing it working through pull requests.  Quite likely if I'd started with an empty git repo and then synched the original plastic repo (with its 190 changesets) then it also would have worked.

I wondered about gitserver although it would require me to open my internal plastic server up to the internet. Not a big deal in itself but more to think about regarding firewalling & other security issues. I think the other developers would like the bitbucket web user interface: they have other projects of their own, and with all due respect, even if I were to give the plastic web ui to them, it's not featured enough.

However my first pull request was weird.  In Plastic there was one branch called "main"

image.png.e63ad3d177e3d98294d42fbf5465d051.png

And my first gitsync I brought down all the original content, plus the single commit done by the other developer.  I then edited their file, checked in, and synched again.  My change is now in bitbucket on a branch called "master"  :

image.thumb.png.d70b5228637f33f61b47a7050e9820fc.png

It seems to me like that should have gone straight to "main".  I know that by default, the first branch in git is called "master"  Nowhere in the plastic UI is there any sign of the branch name,  it's just assuming.  Yet it clearly PULLED from the main branch in git, and I didn't change anything, and now in the branches tab I only see main, with my new changeset at the end of it, so I call Bug:

image.png.f7c0271cf38b4e1d08a4541bb585ff84.png

 

For larks, I tried changing the URL in the GitSync dialog to add /branch/main it complained "The settings you've introduced don't match with the stored ones ...."

 

 

 

Link to comment
Share on other sites

I'll just mention the approx 12 hours difference in our timezones is going to make this a slow conversation!

Oh while on the topic, two things 

* if it wasn't completely clear, my beef with the first GitSync attempt (with a non-empty repo on both sides) wasn't that it didn't work, it was that it crashed with a NullReferenceException (almost always a bug) and no meaningful error message in the UI.

* My first attempt at  cm fast-export  couldn't be imported into git because I had labels with spaces in them - eg "Version 1.2.3"  - I've commented on another thread on this forum.  Since I renamed everything, I'll never know if GitSync could have coped with this scenario.

Link to comment
Share on other sites

Hi @wnicholls

I have just tested the following with a tiny repository so you can replicate my steps in order to find differences:

1) From a Plastic SCM workspace working with a "test1" repository I selected the main branch, right click -> Sync with git.

Now I have the "test1" repo imported into a bitbucket repository, a private one for me.

So far the Plastic /main branch is translated into "master" for git.

2) From Linux, git clone the bitbucket repository. Make a small modification and push it to bitbucket.

Now the bitbucket repository is having one more changeset/commit than the Plastic one. The new git commit is stored at the master branch.

3) Not from Plastic I repeat the "Sync with Git operation", the git commit is translated into a Plastic changeset that is stored inside main, I don't have a "master" branch in Plastic, just "main" and its child branches.

So everything seems to be working just fine by using the "Sync with git" operation, can you test it as well?

 

Link to comment
Share on other sites

I could do this but I think you miss the crux of this.

1) Start with a git repository on bitbucket containing content on one branch  (which is the "MAIN BRANCH" but as it happens is _not_ called "master")

2)  Take empty Plastic repository and sync to https://bitbucket.org/username/reponame.git, All the content from git was brought into PlasticSCM  on a branch called "Main"

3)  Add one changeset in Plastic and commit.  The new changeset is on the end of Main  (as I expect)

4) Sync with Git.   A new branch called "Master" is created with the change in it.  (not expected).

I have fiddled with NOTHING. Plastic has pulled from one branch and pushed to another and the view it has of the project does not match what is in git.  This cannot be correct behaviour.    That the git repo was imported from plastic in the first place just adds to the insult <g>

I've just had another two goes. Here's what I did this time. First time did what you expect. Second did not.

1. Create repo in bitbucket.  It has a branch called "master"  (as is the default).   This time I did not import the fast-export file (not that it was me that did it first time!).

2., I created a branch called  "Anderson" and for good measure another one called "Bruford"(*).  Then in bitbucket Settings, changed the "Main Branch" to "Anderson"

image.png.45aaf0ba85d1623550f487c35dc5f325.png image.png.74e11d636aad476d35629a94bfe4aa4c.png

Now using git I edited the README.md - and committed. All on the main branch "Anderson"

 image.png.39ab3a082d0ff2c436fb5116f71fe1ea.pngimage.png.90888e9d35cd6d8251eb5402d34bca61.png

 

3. Now in Plastic I created a new repository and workspace (also test1).  It has one branch /main

4. Go to branches tab, right click -> Replication -> Sync with Git.   The repository URL I chose is "https://bitbucket.org/wnichollscsl/test1.git" - no branch specified, and note this matches the example given in the guide https://www.plasticscm.com/documentation/gitsync/plastic-scm-version-control-gitsync-guide.shtml#Thefirstpull

image.png.47d00ff47a046079550217ac3b785be8.png

Note how /main claims to be the main branch (in bold, ignore the comment!) even though, in bitbucket, Anderson is.

OK. That looks all right. I'm going to assume that I can work with this from now on.  On to the second go.

1. Create repository in bitbucket called "test2"  - empty (well, template readme.MD)

2. Create new branch "main",  settings set this as main branch, and then  delete the master branch,  Yes really. image.png.7ca2e8225b95598fa5d7187580d81aa8.png

Again one edit on the  "main" branch, to readme.md (to the text "I thought about calling this branch "Rabin" but wanted to duplicate the problem closely")

3.  Now in Plastic, new repo/workspace and sync with  "https://bitbucket.org/wnichollscsl/test2.git" . As you can see, it has synced the "main" branch in git as "/main" in Plastic and has the change :

image.png.15d4a1c69f2bda4e088f4a3894b1210a.pngimage.png.b0171239455c5dedaa54c3d162d2350b.png

Great. Now edit readme.md and commit from plastic & sync:

image.png.614ec52212fa15c8342643586b4a21fd.png  image.png.1fa9906f296889ff41bf40f18ccdd464.png

Now look at Plastic (on the left)  and bitbucket  -  what?  It's created a new branch called master.  This is my problem.

image.png.85882e8096537ea3601deb7901381789.png  image.png.cabfc6a001120d909418f29919abfc4e.png

And for additional fun, I then editing Readme on the git "main" branch, resynced Plastic and updated the workspace.  My change made above (in commit af155be)  is silently lost.  

It still doesn't know there are two branches.

Final test.

  I create plastic/repo  "test2b" and sync that one to the same https://bitbucket.org/wnichollscsl/test2.git, and update. It's branch explorer is rather confused. Again no "/master" branch but at least it knows the lost changeset isn't merged into trunk (ah, main, ah .. whatever we call it)

image.png.e0f0378b351d91e5e52e2b736a76b054.png

I can't afford any more time on this today, but can you see that at the very least, GitSync has some special handling around the names "main" and "master" which is able to go awry.

(* P.S.  for those in the know, not sure which musician to use if I need a "C".  Chris I suppose. )

 

 

image.png

image.png

image.png

image.png

image.png

image.png

image.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...