Laur IVAN

Fix 418 Unused Error on Dreamhost

Posted by in IT

TL;DR: Have a look at the error log and then to the violated rule. Suddenly, I started to get 418 errors on one of my sites. I’d just get 418 from the source and as they say: that was that. Normally, I don’t even notice such errors, but this one broke a bunch of pages. The 418 errors look in general like this:

Now, this translates to an rule for mod_sec2. To fix, you need to go to the file referred by the error, at the specific line and…read more

Fix Not Found Package Errors with .staging Warnings on Npm Install

Posted by in Software

TL;DR: Clean the npm cache and the package-lock.json The other day I started to get ENOENT warning when running npm install like:

only to have the compilation failing with something like:

I’ve looked into it and the conclusion was that the error occurred because I’ve updated my node/npm version. Most answers recommend removing the npm cache either via rm -rf or via npm cache clean. however, this didn’t fix my problem. This issue seemed to match my behavious and one of the solutions was to remove package-lock.json and…read more

Fix TS1144 for e.g. flex-layout

Posted by in Software

TL;DR: Update your typescript version dependency. These days we’re updating some angular apps to the most recent version (6 at the time of writing this entry). Everything is nice, with the exception of various errors we get because of the other dependencies. The most recent one was a TS1144: ‘{‘ or ‘;’ expected in one of the dependencies (flex-layout to be precise). As it’s a popular 3rd party library, it’s more probable the error occurs because of something on our side than on theirs. So… Since it’s a TS error,…read more

Fix *standard_init_linux.go:XXX: exec user process caused “no such file or directory”* Error

Posted by in IT, Tutorial

TL;DR: Use dos2unix While switching from Ubuntu to Alpine images, I’ve encountered the fillowing error: standard_init_linux.go:195: exec user process caused “no such file or directory” Quite unfortunate, because the script stayed in the same spot and only the image changed. After reading a bunch, I figured that it’s the fact that I’m editing on Windows and Alpine doesn’t seem to interpret #/bin/sh properly – adding a ^M :). The solution is to either fix the script locally or to format it as part of the docker build process. I chose…read more

Don’t Symlink Indices in ElasticSearch!

Posted by in IT

The other day I’ve been trying to improve the downtime when updating an index in elasticsearch (ES) and I’ve decided the best approach would be to create a new index and do a symlink to the active one, keeping the valid index. so, my structure would be:

Note: this is likely not a best practice :) This would allow me to build an index with other means, and only do a stop/change link/restart cycle which would be much quicker :) This is simplified, of course, but you get the…read more

Fix Jenkins POM Freezer
“Wrong Relative POM” Error

Posted by in IT, Tutorial

If you get a build error in Jenkins like:

Then you have a POM freezing issue with the parent POM. I.e., the Jenkins plugin has failed to freeze the POM version from a 1.0-SNAPSHOT to an actual 1.0-6034-79. A cause can be the plugin expects a certain sequence of tags in the POM and doesn’t find it. In my case, the initial configuration was:

and the expected configuration would be something like

Note the sequence group – artifactId – version. HTH, A little experiment: If you find…read more

Display a Function’s Errors in Oracle

Posted by in Software, Tutorial

TL;DR: Use the power of DBMS_OUTPUT.PUT_LINE, Luke! I’ve built a function along the lines of:

When using the function, I got some 0 results and I wanted to know why. The solution I got was using DBMS_OUTPUT.PUT_LINE:

Now, all you have to do is enable DBMS_OUTPUT in your environment and you’ll see the exceptions. NOTE: This is useful while building and tuning the function. IMHO one should disable the PUT_LINE statements in production. HTH, A little experiment: If you find this post and ad below useful, please check…read more

Fix “Multiple dex files define L…” Errors

Posted by in Software

Today I got an error when building the APK: Multiple dex files define L/… My scenario is that of a project with 2 modules: a core and an app. Both modules use a plugin named androiddevmetrics, which generate some code, including a class which has the same signature in both modules. The linking (APK generation) resulted in an obvious conflict. My steps to solve this error are: Identify which package/module generates the error. The L/com/android/… will tell you exactly who the culpable is. In my case, the idea is to…read more

Fix Gradle Error: UNEXPECTED TOP-LEVEL EXCEPTION

Posted by in Software

Today I got the lovely UNEXPECTED TOP-LEVEL EXCEPTION from the dexer in android. Looking on the net yielded several causes and resolutions. Note: I’m using Gradle 2.10, Android Studio 2.0.0-beta2 Caching Apparently, sometimes Gradle is shooting itself in the foot with the caching. The first thing you can do is to clean your project. Remove all build directories, all Gradle caches and rebuild. Some references: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException Duplicate inclusion It looks like this is the most common reason for such error. >Duplicate inclusion can occur when your app…read more

Butterknife: ClassCastException: Symbol$VarSymbol …

Posted by in Software

The other day I decided to update my Butterknife from 6.x.x to 7.x.x. Immediately I noticed some refactoring (e.g. @InjectView became @Bind). I updated my code and got build (from Android Studio’s “make”). Unfortunately, when I tried to test it, I got: java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$VarSymbol cannot be cast to javax.lang.model.element.ExecutableElement from Dagger (yes, I’m still using 1.x.x). Annoying to say the least. Solution It turns out that I forgot to refactor a couple of files from my code and Dagger failed to parse dome Butterknife code (I guess?). My solution was…read more