Jump to content

Plastic Windows Service crashes on startup when gitserver.conf exists.


Gerard Murphy

Recommended Posts

Hi,

 

I'm running Plastic SCM Cloud, 5.4.16.771 (Carry on my Wayward Son) on Windows 8.1.

 

The installation proceeded fine, and I can use Plastic SCM up until the point where I wrote a 'gitserver.conf' to enable GitServer.

 

I've placed in in directory 'C:\Program Files\PlasticSCM5\server'.

 

When I restart the Plastic SCM service, it crashes after a second or so. This is repeatable each time, and is not affected by the contents of the 'gitserver.conf' file.

 

Looking at the Windows event log, I see the following stack trace from the server's last error log entry:-

 

Service cannot be started. System.NullReferenceException: Object reference not set to an instance of an object.
   at Codice.CM.Server.SystemRunner.b()
   at Codice.CM.Server.SystemRunner.Init(Boolean bInitInSeparateThread)
   at Codice.CM.Daemon.PlasticService.OnStart(String[] args)
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
 
Looking at the log in 'plastic.debug.log.txt'. I see the following lines:-
 
2016-08-22 09:44:15,294 10848 (null) (null) INFO  Daemon - Initialize Datalayer
2016-08-22 09:44:16,014 10664 (null) (null) INFO  Codice.CM.Server.ComponentLoader - 50 components loaded
2016-08-22 09:44:16,045 4984 (null) (null) INFO  ServiceGarage - Going to init services
2016-08-22 09:44:16,045 4984 (null) (null) INFO  ServiceGarage - SecurityHandler started. 0 ms
2016-08-22 09:44:16,045 4984 (null) (null) INFO  RepositoryHandler - RepositoryHandler InitService
2016-08-22 09:44:16,061 10664 (null) (null) INFO  Daemon - Server listening locally only
2016-08-22 09:44:16,061 7620 (null) (null) INFO  networkserver - Server listening locally on port 8084
2016-08-22 09:44:16,061 7620 (null) (null) INFO  networkserver - Tcp Fast Path enabled
 
2016-08-22 09:44:16,076 10664 (null) (null) DEBUG GitRepo.AssemblyResolver - AssemblyResolve request 'clientcommon, Version=5.4.16.771, Culture=neutral, PublicKeyToken=null'
2016-08-22 09:44:16,076 10664 (null) (null) DEBUG GitRepo.AssemblyResolver - Loaded assembly from 'C:\Program Files\PlasticSCM5\client\clientcommon.dll'
2016-08-22 09:44:16,123 10664 (null) (null) DEBUG GitRepo.AssemblyResolver - AssemblyResolve request 'basecommands, Version=5.4.16.771, Culture=neutral, PublicKeyToken=null'
2016-08-22 09:44:16,123 10664 (null) (null) DEBUG GitRepo.AssemblyResolver - Loaded assembly from 'C:\Program Files\PlasticSCM5\client\basecommands.dll'
 
2016-08-22 09:44:16,154 4984 (null) (null) INFO  DataConnection - SQLite version 3.8.6
2016-08-22 09:44:16,264 4984 (null) (null) INFO  Transaction - Transaction timeout -> 120000ms
2016-08-22 09:44:16,295 4984 (null) (null) DEBUG RepositoryStore - Db for Repositories is correctly initialized
 
2016-08-22 09:44:16,295 10664 (null) (null) DEBUG GitServerConf - Loading git server configuration
2016-08-22 09:44:16,311 4984 (null) (null) INFO  RepositoryStore - Repositories database already exists and is correctly initialized
 
2016-08-22 09:44:16,313 10664 (null) (null) DEBUG GitServerConf - GitServerConfData:
2016-08-22 09:44:16,313 10664 (null) (null) DEBUG GitServerConf - StorageBaseDirectory: 'C:\Windows\system32\config\systemprofile\AppData\Local\plastic4\gitserver'
2016-08-22 09:44:16,313 10664 (null) (null) DEBUG GitServerConf - HttpPort: '80'
2016-08-22 09:44:16,313 10664 (null) (null) DEBUG GitServerConf - TcpPort: '9418'
2016-08-22 09:44:16,313 10664 (null) (null) DEBUG GitServerConf - MappingInterval: '300000'
2016-08-22 09:44:16,313 10664 (null) (null) DEBUG GitServerConf - MappingCsetsLimitBeforeDumping: '0'
2016-08-22 09:44:16,313 10664 (null) (null) DEBUG GitServerConf - SkipUnresolvedXlink: 'False'
2016-08-22 09:44:16,313 4400 (null) (null) DEBUG Git - GitTcpServer listening on port [9418]
2016-08-22 09:44:16,313 9520 (null) (null) DEBUG GitRepo.AssemblyResolver - AssemblyResolve request 'LibGit2Sharp, Version=5.4.16.661, Culture=neutral, PublicKeyToken=null'
2016-08-22 09:44:16,313 9520 (null) (null) DEBUG GitRepo.AssemblyResolver - Loaded assembly from 'C:\Program Files\PlasticSCM5\client\LibGit2Sharp.dll'
 
(STUFF TO DO WITH REPOSITORIES OMITTED - ITS THE SAME IN THE SUCCESSFUL CASE TOO)
 
2016-08-22 09:44:16,375 9520 (null) (null) DEBUG Git - GitHttpServer going to use prefix [http://+:80/]
 
 
(STUFF TO DO WITH REPOSITORIES OMITTED - ITS THE SAME IN THE SUCCESSFUL CASE TOO)
 
 
2016-08-22 09:44:16,484 4984 dcad92eb-6d42-47c6-b515-0586c90d8593 Server:SAGESERPENTLPTP DEBUG GitRepo.AssemblyResolver - AssemblyResolve request 'securitymanager.XmlSerializers, Version=5.4.16.771, Culture=neutral, PublicKeyToken=null'
2016-08-22 09:44:16,484 4984 dcad92eb-6d42-47c6-b515-0586c90d8593 Server:SAGESERPENTLPTP DEBUG GitRepo.AssemblyResolver - Cannot be resolved assembly: 'securitymanager.XmlSerializers.dll
2016-08-22 09:44:16,484 4984 dcad92eb-6d42-47c6-b515-0586c90d8593 Server:SAGESERPENTLPTP DEBUG GitRepo.AssemblyResolver - AssemblyResolve request 'securitymanager.XmlSerializers'
2016-08-22 09:44:16,484 4984 dcad92eb-6d42-47c6-b515-0586c90d8593 Server:SAGESERPENTLPTP DEBUG GitRepo.AssemblyResolver - Cannot be resolved assembly: 'securitymanager.XmlSerializers.dll
 
It looks like there is an assembly missing from the distribution.
 
Any chance of a quick fix or workaround? - I want to show some work to the customer who uses Git this week, so it would be very much appreciated.
 
Regards,
 
Gerard
Link to comment
Share on other sites

I've rolled back Plastic SCM to the previous released version: 5.4.16.769 (Every Breath You Take) - this fixes the problem for me for now; I can start the Plastic SCM service and use GitServer.

 

I looked through 'plastic.debug.log.txt' again after deleting the old contents and restarting the server; I'm still seeing the same assembly resolution failures as in the original post above, even though the service now starts up correctly and works, so I guess that information was irrelevant after all.

Link to comment
Share on other sites

Hi Manu,

 

Thanks for the tip - I'll stick with the Cloud edition for now, as I think I'd have to have the full paid regular server license to run GitServer if I remember correctly - I went for the Cloud edition as an easier way to manage the fee. I'll wait for the fix to come out, please post an update when it does.

Link to comment
Share on other sites

  • 5 months later...

Hi,

I am encountering similar problems in a similar situation.

 

I am attempting to integrate Plastic Cloud with Unity Cloud build.

My thinking so far has been:

1. Begin using Plastic Cloud backend for team collaboration

2. Rent a VM in Azure with a static IP address, install a Plastic (Cloud Edition) server on the VM

3. Configure the new Plastic server to run as a GitServer     <==== here is where I am stuck

4. Configure the new Plastic server to replicate all repositories from the Plastic Cloud backend

5. Configure the VM to allow incoming traffic to the Plastic server's GitServer TCP port

6. Configure Unity Cloud Build to listen to changes in one of the repos within the Plastic server's GitServer

 

This is the error message I get, whenever I have a gitserver.conf file in place:

Quote

 

C:\Program Files\PlasticSCM5\server>plasticd --console
Object reference not set to an instance of an object.

 

See attached file for the full debug log.

I am not sure if this is a problem with Plastic, or if it is the Windows Server 2016 VM which is configured not to allow plasticd.exe to do what it needs to.

It appears that this is a no-go using the Plastic (Cloud Edition) server due to the above mentioned bug. Shall I try this with the Plastic (non-Cloud Edition) server or will I run into licensing problems? I'm fine with paying for one extra license if need be, but will not pay for extra licenses for all members on our team.

 

plastic.debug.log.txt

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

it took some time before I got around to looking into this, sorry. The problem is not to do with missing incorrect port choices; I tested with tcp.port and http.port as in the attached config file and it did not help. Rather, I think the problem is a mismatch of expectations and a remoting.conf file which does not exist in the right place specifically in Plastic Cloud edition.

 

Decompiling servercommon.dll gives me the following SystemRunner class:

namespace Codice.CM.Server
{
	public class SystemRunner : ISystemRunner
	{
		private static bool bool_0;

		static SystemRunner()
		{
			SystemRunner.bool_0 = false;
			...
		}

		public static void EnableGitServerFeature()
		{
			SystemRunner.bool_0 = true;
		}

		public void Init(bool bInitInSeparateThread)
		{
			...
			if (SystemRunner.bool_0 && gitrepo.d2.d())
			{
				this.method_1();
				this.method_2();  <=== exception thrown within this method
			}
		}
	}
}

Ok, so the error only occurs when the Git server feature is activated.

Now, method_2:

		private void method_2()
		{
			ISecurityHandler securityHandler = ServiceGarage.Get().FindExternalService("SecurityHandler") as ISecurityHandler;
			gitrepo.a.a(ServiceGarage.Get().FindExternalService("RepositoryHandler") as IRepositoryHandler, ServiceGarage.Get().FindExternalService("BranchHandler") as IBranchHandler, ServiceGarage.Get().FindExternalService("MarkerHandler") as IMarkerHandler, ServiceGarage.Get().FindExternalService("ItemHandler") as IItemHandler, securityHandler, ServiceGarage.Get().FindExternalService("InfoHandler") as IInfoHandler);
			gitrepo.ks.a(string.Concat("localhost:", ServiceGarage.Get().GetListenPort()), ServerConf.Get().GetSEIDWorkingMode(), securityHandler);
			gitrepo.fo _fo = gitrepo.d2.c();
			gitrepo.ks.a(_fo.b);
			gitrepo.ks.a(_fo.n);
			if (_fo.b())
			{
				gitrepo.fn.a((long)_fo.d);
			}
			if (_fo.a())
			{
				gitrepo.d1.a((long)_fo.c);
			}
			gitrepo.e2.a(this.method_3(), ServerConf.Get().Port.Number, _fo.b(), (long)((_fo.b() ? _fo.d : _fo.c)));  <=== exception thrown here
			gitrepo.dx.a(_fo.e, _fo.f, _fo.h);
		}

The reason for the exception is that ServerConf.Get().Port is null:

-		ServerConf.Get()	{Codice.CM.Server.ServerConf}	Codice.CM.Server.ServerConf
		CloudRoleUrl	null	string
		FrontendPort	null	Codice.CM.Server.PortConf
		Port	null	Codice.CM.Server.PortConf
		RemotingConfigFile	"c:\\Program Files\\PlasticSCM5\\server\\remoting.conf"	string
		SslPort	null	Codice.CM.Server.PortConf
+		class30_0	{Class30}	Class30
+		class31_0	{Class31}	Class31
+		configFiles_0	{Codice.CM.Server.ConfigFiles}	Codice.CM.Server.ConfigFiles
		enum0_0	const_0	Codice.CM.Server.ServerConf.Enum0
		icloudStorageConfigurationProvider_0	null	Codice.CM.Server.ICloudStorageConfigurationProvider
		int_1	-1	int
		portConf_0	null	Codice.CM.Server.PortConf
		portConf_1	null	Codice.CM.Server.PortConf
		portConf_2	null	Codice.CM.Server.PortConf
+		seidconfig_0	{Codice.CM.Server.SEIDConfig}	Codice.CM.Server.SEIDConfig
+		serverConfigData_0	{Codice.CM.Server.ServerConfigData}	Codice.CM.Server.ServerConfigData
		serverType_0	Local	Codice.CM.Server.ServerType
		short_0	-1	short
		string_2	null	string
+		Static members		

... and that variable is null is because a method in ServerConf fails the file-exists test:

		private void method_0()
		{
			...
			if (!File.Exists(this.configFiles_0.RemotingConfigFile))
			{
				return;
			}
			...
			this.portConf_0 = new PortConf(remotingConfigParser.TcpPort);
			this.portConf_2 = new PortConf(remotingConfigParser.FrontendPort);
			this.portConf_1 = new PortConf(remotingConfigParser.SslPort);
		}

 

There is no file at C:\Program Files\PlasticSCM5\server\remoting.conf on my own workstation. I have Plastic Cloud Edition installed on it currently.

I have also installed Plastic Cloud Edition on a new Azure VM; remoting.conf does not appear in that folder either.

 

If I copy the file from C:\Program Files\PlasticSCM5\server\config_samples\remoting.conf to C:\Program Files\PlasticSCM5\server\remoting.conf then both the Plastic server on my own workstation and the one on Azure VM starts up successfully, it seems ("Plastic SCM daemon up" message in console, a handful of lines about GitServerConf the logs).

 

I have not tested what it looks like when installing Plastic Server on a machine. Will just use the remoting.conf and see how well the GitServer feature works for me now.

gitserver.conf

Link to comment
Share on other sites

Hi,

You should be installing a regular Plastic server in the virtual machine. Actually we don't even provide such a Plastic Cloud edition server. In the Cloud Edition installer, it's true that we transparently install a local server to handle your local repositories (but only the local user can connect to this server). If you want install a server in a VM and connect to it from a remtote client, please use the regular Plastic installer to install the server (this server includes by default the necessary "remoting.conf" file).

NOTE: If I properly understand, you are going to use this server as a backup of your cloud repositories, but you need a regular Plastic server for that purpose.

Regards,

Carlos.

 

 

Link to comment
Share on other sites

Ah -- yes, I have migrated to a regular Plastic server installation, and now the GitServer functionality works & I can replicate from Plastic Cloud to the regular Plastic server. Thank you.

(Side note: if the regular Plastic server does not have encryption configured, but Plastic Cloud has it, then you can browse remote repositories, but replication/pulling via the GUI from Cloud to regular server fails with no error message. Replication via the command line gives an informative error message though: "The server '<organization@cloud>' requires encryption, but this server is not configured to use encryption. Please configure the encryption for this server.")

I have successfully connected Unity Cloud Build to the regular Plastic server. Unfortunately the GitServer module does not support any form of authentication. It is not acceptable to us to have the repository content available to the whole world, and IP address restrictions will not work since Unity Cloud Build is a cloud service. I could introduce authentication by putting another regular Git server between UCB and the regular Plastic server -- but that would be a project for another week.

Link to comment
Share on other sites

Hi,

Regarding your side note, what Plastic version are you using? Windows, Mac, Linux? When you run a replica from/to a cloud organization with encryption enabled the client should open a panel for you to enter the password and configure the encryption. It shouldn't be necassry to manually configure it. Anyway, it's also doable:

 

The "cryptedservers.conf" file configures the encryption organizations and the key file path. 

Each line of the "cryptedservers.conf" has two fields:

Organization@cloud c:\PathToTheKey\file.key

The "file.key" has two fields:

AES128 MyPassword

- If you remove the "cryptedservers.conf" file from the "server" folder, as soon as you run a sync to the cloud, you will be requested to enter the encryption key again.

 

It's on our roadmap to include a security layer in the GitServer feature but I'm afraid it's not ready yet :(

Regards,

Carlos.

Link to comment
Share on other sites

Thanks for the tips.

I created a clean Azure VM and installed 5.4.16.814 on it. This time, I get a useful error message during the "Pull branch" operation: "The server '<organization>@cloud' requires encryption, but this server is not configured to use encryption. Please configure the encryption for this server." However, it does not ask me to enter encryption password. I have not found any place under Preferences where I can enter the encryption password.

(I have not tested, but I expect that if I copy over the cryptedservers.conf + keyfile from my local workstation to the Azure VM, then the Plastic installation will be able to pull from our Plastic Cloud organization.)

 

Here are my full reproduction steps:

  1. Have access to a Plastic Cloud organization, with encrypted repositories
  2. Set up a new VM in Azure, running Windows 2016 Datacenter
  3. Install .NET 3.5 Framework
  4. Download & install Plastic SCM regular edition, version 5.4.16.814. Accept all defaults during installation.
  5. Create a local repository called repo_zero.
  6. Select "Preferences", "Profiles". Add a profile for <organization>@cloud. Click "Connect". Enter an appropriate Plastic Cloud account name and password. Click "Check" to verify that the account credentials are correct. Click "OK", "OK" to dismiss profiles & preferences views.
  7. Select Cloud.
    1. Before doing anything, the "server" field is blank, and no repos are listed.
    2. Enter <organization>@cloud as server, and press enter once. This results in no repos listed, and a message about "You don't have repositories on your Plastic Cloud organization (<organization>@cloud ) yet. ..." in a yellow bar at the bottom.  <===== at this point the UI is giving me incorrect information.
    3. Press enter again. The yellow bar remains at the bottom, but now all cloud repos are listed.   <=== at this point the UI is giving me inconsistent information.
  8. Select Repositories & Workspaces, Repositories.
    1. Create a new repository called ReplicationTest. This will be created on localhost:8087.
    2. Right-click on ReplicationTest and choose "View branches". This will show the /main branch on ReplicationTest@localhost:8087 as the only available branch.
      1. Right-click on /main, choose "Replication", "Pull from remote branch".
      2. For server name, enter <organization>@cloud.    <=== If I browse, no options are listed: I need to enter the server name manually.
      3. Click on "..." after "Repository", browse, pick a repository.
      4. Click on "..." after "Branch", browse, pick a branch.
      5. Click on "Replicate". The replication dialog with the double circles show up, and less than a second later the error message "The server '<organization>@cloud' requires encryption, but this server is not configured to use encryption. Please configure the encryption for this server." is displayed in a separate popup box. There is no request for me to enter the encryption password. When I click OK, the replication operation fails.

(Regarding point #7: Since after I shut down the Plastic SCM Client and restarted it once, the Cloud view is now defaulting to server = <organization>@cloud, it immediately shows the repos, there is no "You don't have repositories..." message in a yellow bar at the bottom.)

Link to comment
Share on other sites

Hi,

I understand the problem. The encyption panel is opened when you are trying to replicate between cloud and local repositories when you are using Plastic Cloud edition (the most common replica scenario when involving the cloud). But if you are replicating between the cloud and a regular external Plastic server, you will need to manually configure the encryption in the regular server. 

Copying the "cryptedservers.conf" +  key file should work. Anyway, if you still face any issue with the manual configuration, we will be happy to assist you.

Regards,

Carlos.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...