Fixing docker service startup after using an alternative graph driver

So I was playing around with devicemapper docker storage driver the other day. It was quite nice but when I stopped the modified docker daemon and tried to start the docker service in “normal” way, I received the following error:

Clearly something had gone wrong. Upon running:

I found the following line most helpful in fixing the error:

So I ran the following command in order to remove my devicemapper driver:

Boom it worked!

Alternatively, I could’ve backed it up to tmp instead by running:

But I didn’t need any of my images anyway so I removed it.

Hope this helps.

Which process is using this port?

Sometimes, I get errors like “address is already in use” but struggle to find out what’s using that port. This happens especially with loads of stuff running in background like docker, vagrant vms, local server instances, ssh tunnels etc.

Here’s an easy way to figure out whats running on a certain port:

The second last column refers to the process using that port.

For example, running that on my mac:

Indicates that process ID 5500 is using port 8080. Doing a process check on that tells me:

Hope this helps!

Enable tomcat debugging

Shutdown tomcat and make sure that it has properly shut down by monitoring the tomcat process.

Once it has completely shutdown, export the following environment variables:

Here, we’re setting the jpda address to port 8000. Note this down as you will need this port number in order to connect via your IDE or whatever debugging tool you’re using.

Options above will run tomcat as usual so if you want to debug something that happens early on in the lifecycle, you either need to be really quick about attaching your debugger or add the following JPDA option:

This will suspend the tomcat startup until you attach your debugger.

Next, start tomcat jpda using catalina script:

At this stage, you can monitor the log in catalina.out file to make sure everything goes smoothly.

Now setup your IDE to connect to tomcat at port 8000. If you are using vagrant as your VM, make sure you are port forwarding 8000 in your network settings. If not, you can always tunnel in:

Or if its a remote server, you can just use the normal ssh command:

Hope this helps!

Credits

  • Conor Restall: For suggesting JPDA_SUSPEND option.

Forgerock UnSummit Bristol 2017 Notes

Deciding on agenda of the day

10:00 Kickoff

Agenda of the day
Finalised agenda of the day @ Forgerock UnSummit Bristol 2017

Forgerock on Docker

Start off with base docker image containing OpenAM. This docker image has a folder for config which can be volume mounted to allow loading custom config. During runtime, it detects the config and runs it against amster (ssoadm replacement).Continue reading →

Generating random passwords from linux command line

Managing production passwords isn’t a trivial task. I was trying to deploy a containerized app the other day that had a database deployed with it. During the deployment, I was trying to find an easy way to set a secure password. I didn’t want anyone to know the password because I wanted only the application to know it and no one else. Also, the container was setup in a way that the database cannot be accessed from the outside world.

So instead of hard-coding the password, after doing some research, I used the following command:Continue reading →

%d bloggers like this: