Common practice if we find a problem after deploying a web application?

I recently had a problem with the fact that my java code works fine on my local machine, however it just doesn't work when I deploy it to a web server, especially in the database part. Worst of all, the server is not my machine. So I had to go back and forth to check the software versions, db accounts, settings, etc ...

I must admit that I did not work very well with the logging mechanism in the system. However, as a novice programmer with little experience, I had to accept my learning curves. Therefore, a very general, but important question arises here:

According to your experience, where would he most likely be mistaken when he works perfectly on a development machine, but completely surprises you on a production machine?

Thank you for sharing your experience.

+4
source share
8 answers

Absolute number one reason for problems arising in the manufacturing process, but not in development, Environment .

Your production machine is most likely configured quite differently than your development machine. For example, you can develop your Java application on a Windows PC when deployed to a Linux server.

It is important to try and develop the same applications and libraries that you will implement in production. Here is a quick checklist:

  • Make sure that the version of the JVM you are using in development is the same on the production machine ( java -version ).
  • Make sure that the application server (e.g. Tomcat, Resin) is the same version as during development.
  • Make sure that the version of the database you are using is the same as during development.
  • Ensure that the libraries (such as the database driver) installed on the production computer are the same versions as in development.
  • Verify that the user has the correct permissions on the production server.

Of course, you cannot always get the same thing - many Linux servers now work in a 64-bit environment, while this is not always the case (for now!) With standard development machines. But, the rule remains that if you can get your environment as close as possible, you will minimize such problems.

Ideally, you should create an intermediate server (which can be a virtual machine, not a real server) that has (or as close as possible) to the same environment as the production server.

If you can afford an intermediate server, the deployment process should look something like this:

  • Ensure that the application runs locally during the development process and ensures that all unit and functional tests are passed into development
  • Deploy on an intermediate server. Make sure all tests pass.
  • Once you are happy, turn around to production
+5
source

Most likely you are working under a different user account. Thus, the environment that you inherit as a developer will be significantly different from what you are a production user (which is likely to be a very truncated environment). Your PATH / LD_LIBRARY_PATH (or Windows equivalents) will be different. Permissions will be changed. In addition, the installed software will be different.

I would highly recommend maintaining a test box and a test user account that is configured with the same software, permissions, and environments as the production product. Otherwise, you really cannot guarantee anything. You really need to manage and control production and testing servers. accounts / installed software, etc. Your development box will always be different, but you need to be aware of the differences.

Finally, verifying the reasonableness of deployment is always a good idea. I usually use a test URL that can be checked as soon as the application is deployed. It will fulfill queries to the database or any other key functions, and explicitly report that it works / does not work using the traffic light mechanism.

+4
source

In particular, you can check all configuration files (* .xml / *. Properties) in your application and make sure that you do not hard-code any paths / variables in your application.

You must support different configuration files for each env. and check the installation guide from env admin. (if exists)

Other than these versions of all program / dependency lists, etc., as described by others.

+2
source

A production machine is likely to miss some of the libraries and tools that you have on your development machine. Or there may be older versions. In certain circumstances, this may interfere with the normal function of the software.

The situation with the connection to the database may differ, which means users, roles and access levels.

+1
source

In my experience there is no definite answer to this question. Below are some of the issues that I have encountered.

  • Automatic updates were not enabled on the dev server (windows), and it was enabled on the production server (which is wrong in the first place!). Thus, one of my web applications broke out due to the application of the patch.

  • On the production application server, several batch jobs were launched that changed some of the data on which my application was used.

  • It's not me who does the deployment for my company, so most of the time people who deploy, skip some registry entries or add the wrong registry entries. Simple, but very difficult to detect (maybe for me ;-)), as soon as I spent several hours to identify a space in one of the registry values. Now we have a very long release document that contains all the information about all the servers used by the application, and there is a checklist for the "current version", which is filled out by the developers who deploy the application.

Will will add more if I remember anything else.

+1
source

One common (albeit easily detectable) problem is conflicting libraries, especially if you use Maven or Ivy to manage dependencies and do not check all managed dependencies at least once before deployment.

We had many incompatible versions of registration frameworks and even the Servlet / JSP API. jar: too many times in our test deployment environment. It is also always useful to check what the shared library folder of your tomcat / equivalent contains, we encountered some conflicts of the database database class, because someone put jgbc jar jgbc in the shared folder, and the project appeared with its bank to connect jdbc.

+1
source

I am always trying to get an exact copy of the server my product is running on. After some applications and, of course, a lot of errors, I created myself a list of common errors / tips. Another solution that I tested for my latest project was to run the running software on this server and try to configure it. Strange effects can happen with this ^^

And last but not least. I always test my applications on different machines.

+1
source

Beyond a simple staging server, another strategy to ensure that the environments in which you are deploying are the same is to make sure they are configured automatically. That is, you use a tool like Puppet to install all the dependencies that the server has and run the installation process before each installation, so that the entire configuration is reset. Thus, you can make sure that the field configuration is what you installed during the development process, and the configuration of the production environment in the original control.

+1
source

All Articles