App server integrated with my IDE? Nah. I'll spin up a new VM with a packaging-compliant version, secured as close as possible to the deployed instance.
There's just something about creating your own deployment instance that helps me settle in. Now I know why Tomcat and NGINX have trouble speaking SSL to each other.
And it also uncovers trivial, yet easily hidden, deployment errors early.
Not long ago, we had an intern code up a small metrics collection component. I was on a task that had me touching just about all parts of the code, which caused me to get quite a bit out of sync with the primary development branch. Other developers were happily chugging along, pulling the new code, finishing tasks from the backlog. Happy times.
I finally reached a stable point where I could start merging in the fast moving development line (trying to avoid really intense merges). It all merged in without much trouble. I had it building a new WAR, and felt pretty confident.
Then, I tried to run it in my (non-standard) environment. Hmmm, what's this "ERROR" message? Perhaps it can be ignored as an in-progress task?
"Can't create /metrics.tmp"
What? Why is it trying to create a file in the root directory? Time to dig!
Oh. The new metrics code did not specify a directory - or offer a property to specify one - when creating a temporary file for collecting the metrics.
How did it work? Well, he was fully setup with the standard environment, which ran Tomcat from his Eclipse IDE (no, I deviate here too and use IntelliJ). The file was created without issue since the default directory was his home directory, and Tomcat ran under his identity.
Even deploying it to a development test environment did not uncover the issue, as
The failure did not stop the overall startup process. Everything ran, and Metrics was not a priority for testing a pre-MVP product. It was still using a "development" environment setup, so the creation succeeded, though put the file alongside the application installation directory.
So, the next time you start following the "New Developer Environment Setup" docs, you may want to try a few deviations. It may save some troubleshooting down the line.
So, the next time you start following the "New Developer Environment Setup" docs, you may want to try a few deviations. It may save some troubleshooting down the line.
No comments:
Post a Comment