Jump to content

Address already in use


Recommended Posts

I get the following in my log when I attempt to 'sudo plasticd --console'
 
plastic.server.log:

2014-10-08 03:11:10,807 a22f659a-ca05-441c-af87-19270000638d root at Server:ip-172-31-47-174 INFO  Transaction - Transaction timeout -> 120000ms
2014-10-08 03:11:10,949  root at  INFO  Channel - 'sinklevel' compression mode set. all metadata will be serialized
2014-10-08 03:11:10,949  root at  INFO  Channel - 'BufferPoolMax' is set to '10'. It sets the maximum number of available buffers for object data transfers
2014-10-08 03:11:10,949  root at  INFO  Channel - 'SerializationObjectsAtSink' is set to 'True'. True means SerializationBase descendants are  directly written into the response $
2014-10-08 03:11:10,962  root at  INFO  Channel - Start listening
2014-10-08 03:11:10,964  root at  INFO  Channel - 'sinklevel' compression mode set. all metadata will be serialized
2014-10-08 03:11:10,964  root at  INFO  Channel - 'BufferPoolMax' is set to '10'. It sets the maximum number of available buffers for object data transfers
2014-10-08 03:11:10,964  root at  INFO  Channel - 'SerializationObjectsAtSink' is set to 'True'. True means SerializationBase descendants are  directly written into the response $
2014-10-08 03:11:10,965  root at  INFO  Channel - Using certificate file ssl-certificate.pfx
2014-10-08 03:11:11,033  root at  INFO  Channel - Start listening
2014-10-08 03:11:11,036  root at  FATAL Daemon - Configuration file '/opt/plasticscm5/server/remoting.conf' could not be loaded: Address already in use

 

 
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| rep_1              |
| repositories       |
+--------------------+

 

 

<DbConfig>
  <ProviderName>mysql</ProviderName>
  <ConnectionString>Server=localhost;Uid=plastic;Password=madeyoulook;Database={0};Pooling=true</ConnectionString>
  <DatabasePath></DatabasePath>
</DbConfig>

 

 

 
I cannot get the Plastic server to run. I used 'ps -ax | grep plast' and it doesn't show up so it appears to not be running.
 
To address the timeout issue: I've added <CommandTimeout>300</CommandTimeout>.  It doesn't help. I've also tried adding the "default command timeout 20" line to the connection string.
 
I'm aware my connection string uses "Uid" instead of "User ID".  I think this is actually more correct after doing some googling. Changing it back and forth has no bearing on these error messages. The output is the same.
 
As far as the "Address already in use":  Investigation into this has yielded an explanation that the port is in use. However, I've tried 8087, 8088, 12345, 51111.  All of them produce the same error message and for this reason I suspect this is not the issue.
 
My background: I come from a strong Windows background with some shared hosting web server experience. If I need to run any commands on SSH, please type them out to save me huge amounts of time and lower my learning curve. Any help is appreciated.
 
Link to comment
Share on other sites

Discovered this as well:

 

If I 'sudo plasticsd start' I get the following:

 

Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file.

Starting PlasticSCM server: Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file.
Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file.
Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file.
Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file.
^C
 
Indeed. If I navigate to the folder I see the lock file. 
 
If I 'sudo rm /tmp/plasticd5.exe.lock', verify the file is gone, and then attempt to 'sudo plasticsd start' again, it just gives me the same error. No change.
Link to comment
Share on other sites

I appear to have fixed it. The solution to all this insanity was to

 

apt-get purge plasticscm-client plasticscm-server

then

apt-get install plasticscm-client plasticscm-server 

 

I simply reinserted my backup of the db.conf file with the mysql settings back into place and tested it. Worked. Rebooted the instance and all and it continues to work.

 

Note: Before I reinstalled PlasticSCM, I also attempted to add the mono-runtime and mono-complete using apt-get, but it did not help. Also, mono-complete failed to install all packages so I purged only mono-complete before doing the above purge and install of PlasticSCM. And now everyone works. So far so good. I hope this helps someone.

Link to comment
Share on other sites

I broke it again.  I was using this Plastic server happily and I decided I wanted to change the port from 8087 to 8088 before I ask another team member to start using it.  I logged into SSH and the following shows you the ENTIRETY of my actions:

 

$ sudo clconfigureserver

####--- Server configuration wizard ---####
Configuring language. These are the available languages:
1. English
2. Spanish
Choose a language (type a number): 1

------------
 

Configuring users/security working mode. These are the available modes:
1. NameWorkingMode
2. NameIDWorkingMode
3. LDAPWorkingMode
4. ADWorkingMode
5. UPWorkingMode
Choose a mode (type a number): 5
 
------------

Configuring server listening port ...
Server working port [8087]: 8088

PlasticSCM server has been correctly configured ...

$ sudo plasticsd restart
Stopping PlasticSCM server:                                          OK
Starting PlasticSCM server: Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file.
Warning: /tmp/plasticd5.exe.lock lock file exists but process is not running. Please delete this file.

 

 

 

That's all it took to break it!

Stopping the server, deleting the tmp file, changing the port back to 8087, and rebooting the instance does not fix this problem. My server is broken again and I do not know how to proceed. The fragility of this is very concerning. 

Link to comment
Share on other sites

Fixed it again with the folllowing:

sudo apt-get purge plasticscm-client plasticscm-server
sudo apt-get install plasticscm-client plasticscm-server 
cd /opt/plasticscm5/server 
sudo plasticsd stop
sudo cp db.mysql.conf db.conf  (this is my backup of my settings)
sudo plasticsd start

I get the OK.

 

I do 'sudo plasticsd restart' 5 times and get the OK.  Everything is fine .... for now.

 

Best I can tell is the problem is either intermittent, or fooling around with the configuration corrupts something until PlasticSCM is reinstalled.  Terrifying.

Link to comment
Share on other sites

Please don't panic.

 

When the server starts the lock file is created.

 

If, for some reason, the server is killed or dies and the lock file is not deleted you will have the server complaining about the file. The solution is simple, delete the lock file manually.

 

On the other hand, as you said, if you attempt to manually "sudo plasticd --console" and you get the the "Address already in use" error it means a Plastic SCM server instance is already running, the solution is also simple, kill it or stop it, then you will be able to start the server in the console mode.

Link to comment
Share on other sites

Please don't panic.

 

When the server starts the lock file is created.

 

If, for some reason, the server is killed or dies and the lock file is not deleted you will have the server complaining about the file. The solution is simple, delete the lock file manually.

 

On the other hand, as you said, if you attempt to manually "sudo plasticd --console" and you get the the "Address already in use" error it means a Plastic SCM server instance is already running, the solution is also simple, kill it or stop it, then you will be able to start the server in the console mode.

 

Thanks for the reply.

 

Hmmmm. Deleting the lock file manually does not fix the "lock file" error. If It did I wouldn't be here posting because I would have fixed in two minutes on my own. Deleting the lock file and attempting to start the Plastic server manually with "sudo plasticsd start" yields the lock file error again even though the lock file has been deleted. The problem continues even if the lock file is deleted and the instance is rebooted. Once the "lock file" error shows, it seems the only solution is to purge and reinstall PlasticSCM.  

 

Indeed. If I check my notes from Post #2 in this thread ( http://www.plasticscm.net/index.php?/topic/2370-address-already-in-use/#entry14866 ) I have stated that deleting the lock file and then trying to start the Plastic server again does not help. Look closely because in Post #2 I said that I even verified that the file was missing so I'm 100% certain.   I also stated the "lock file" problem doesn't go away in post #4.  I'm very consistent with my notes.

 

Let's put this another way. Take a look at my Post #4 ( http://www.plasticscm.net/index.php?/topic/2370-address-already-in-use/#entry14874 ) where I attempted to configure the server and then reboot it so it would see my simple port change. I encountered the lock file problem just trying to restart the server.  

 

What did I do wrong? (jokingly) Is rebooting the server not allowed? :)

 

 

Re: sudo plasticd --console

 

Thank you. I do see this as a possibility as I don't much understand the difference between plasticd and plasticsd. However, for my last few posts I have abandoned all attempts to use plasticd and have been sticking to plasticsd instead in order to narrow down the "lock file" problem. Now that I know I can (and probably should) get the server working fully with plasticsd I won't be touching plasticd unless I am asked to.

Link to comment
Share on other sites

  • 4 weeks later...

Ok,

 

today I reproduced your issue.

 

For some reason the server rejects to be killed by the plasticsd script.... I had to manually kill the server + delete the lock + start the daemon to perform a restart. I got the server PID with "ps -Af | grep plastic".

 

Differences between plasticsd and plasticd:

  • plasticd: It's an script that basically runs "mono plasticd.exe"
  • plasticsd: It's an script that allows to start and stop the plasticd daemon. It supports "stop|start|restart|status"

Server modes:

  • Console: "mono plasticd.exe --console" or "plasticd --console" will start the server in console mode, it will live until the console is manually closed. You can start it from an script + & and will live in the background.
  • Daemon: "mono plasticd.exe --daemon" or "plasticd --daemon" will start the server in the background.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...