1

When I go to check something into MorphX VCS right now, I get the following message:

Cannot create a record in SysVersionControlMorphXRevisionTable (SysVersionControlMorphXRevisionTable). The record already exists.

With things that have already been checked out once, I've been able to resolve this with a get latest and then a new checkout/check in. However, when it comes to doing an Add, I'm completely stuck. Is there a resolution to this or have we completely borked our VCS?

Note: this error is only given when we try to check in from a development project. Checking in directly on the AOT does not give this issue.

wax eagle
  • 541
  • 11
  • 27

1 Answers1

3

Just look at the table SysVersionControlMorphXRevisionTable (in SQL if you can't access) and see what the duplicate record could be. The unique index is ItemPath and Version. I doubt you'll see anything here though.

It's most likely an issue with the call in this method \Data Dictionary\Tables\SysVersionControlMorphXRevisionTable\Methods\latestVersionNumber where it's trying to get the current highest revision and is being called by \Data Dictionary\Tables\SysVersionControlMorphXRevisionTable\Methods\create.

Put a breakpoint in the create method line #48 and see what revision.Version is, and before the insert, check in SQL if the ItemPath/Version already exists in SQL.

I'd guess it's probably a server/client-caching issue. To resolve, refresh all of your client caches under Tools>Caches. If this doesn't resolve, and it's a good idea to do anyway, copy these menu items:

  • \Menu Items\Action\SysFlushAOD
  • \Menu Items\Action\SysFlushData
  • \Menu Items\Action\SysFlushDictionary
  • \Menu Items\Action\SysFlushReportServer

To a new menu item and change the property RunOn = Server. Then run these and it'll flush your server caches. If this still doesn't work, try restarting the AOS.

If this doesn't work, your users application user cache files might be corrupt. Close your client and delete the *.auc and *.kti files in %LocalAppData% folder (Typically C:\Users\[user]\AppData\Local) and reopen your client.

In the environment you are using, have you restored a copy of another database somewhat recently?

Edit: Now knowing that you did a DB restore, there is a good chance your GLOBALGUID was reused and/or is causing caching issues. See here for more info about how/why this happens.

You should probably stop your AOS and run these SQL commands:

UPDATE SYSSQMSETTINGS SET GLOBALGUID = '00000000-0000-0000-0000-000000000000'
DELETE FROM SYSCLIENTSESSIONS
DELETE FROM SYSSERVERSESSIONS

Are/were you also having issues with batches running? (Somewhat related, but I'm mainly just curious on this question)

Alex Kwitny
  • 11,211
  • 2
  • 49
  • 71
  • re: restored copy of another database, yes, definitely. We had an issue a couple of refreshes ago where we forgot to check everything in and our lock table got wiped. – wax eagle Dec 15 '14 at 17:41
  • If you recently restored a copy of another database, then there is a good chance your `GLOBALGUID` was reused. Look at my post again, I just edited it. – Alex Kwitny Dec 15 '14 at 17:57
  • we don't currently have any batches, we're in the early phases of implementation. – wax eagle Dec 15 '14 at 18:00
  • I've noticed when you get issues like you're having, sometimes batches won't run no matter what because somehow the restore and GUID mess up the batch time. To resolve just run `update_recordSet batchGlobal setting LastProcFinishedJobs = DateTimeUtil::addHours(DateTimeUtil::utcNow(), -1);` Hopefully my steps above solve your issue though. – Alex Kwitny Dec 15 '14 at 18:29
  • this was all great information(specially the GUID stuff, I've forwarded that on to my boss to deal with). We just figured out that there is some kind of weirdness going on with development projects (possibly from our vendor's customizations?) as we can check in directly from the AOT...Will let you know if the GUID fix ends up solving that weirdness. – wax eagle Dec 15 '14 at 18:44
  • Ok good luck. Have you at least tried the breakpoint to see what duplicate data it's trying to insert? Sometimes stepping through it manually fixes it too. – Alex Kwitny Dec 15 '14 at 19:09
  • I had checked it in with the debugger on, and it worked, now it works normally, so I'm guessing that stepping through fixed it. – wax eagle Dec 15 '14 at 19:39
  • This could imply that you haven't refreshed your WCF settings in the AXC file you're using. Open Dynamics Config Utility, then on the `Connection` tab refresh your configuration and save. Do this for your business connector target config too. Also verify your client/server kernel/app builds match via Help>About in AX. – Alex Kwitny Dec 15 '14 at 19:58