[JIRA] Lexorank integrity issues?

So, this is loosely another part of the unofficial series ‘fixing a corrupted JIRA db‘.

However, this is a different case. This JIRA instance (7.1.x) was created by importing a huge XML backup (> 1 million issues). Due to an unknown reason, ActiveObjects didn’t import. That means, JIRA Software (aka JIRA Agile) no longer functioned normal.

It was soon discovered that Lexorank integrity checks fail. For the record, following integrity checks failed:

Marker rows present in table for rank field
Marker rows correctness check
Marker rows in valid bucket check
Issue rows in valid bucket check
Balance status check

Now what? I made an unsuccessful attempt of uninstalling JIRA Software, then dropping all database tables/ triggers/ sequences with the prefix AO_60DB71_ and then re-installing JIRA Software. This didn’t help.

Then, I wanted to study the under-the-hood stuff of Lexorank management. I already knew of two database tables involved, AO_60DB71_LEXORANK and AO_60DB71_LEXORANKBALANCER.

First I created a custom field of type ‘Global Rank’ and named it ‘Rank2’.

Then, I navigated to JIRA Administration –> System –> Lexorank management. Now I could see two Rank fields under the Balancing section. I balanced them once again and executed the integrity checks. The old one still failed the above checks, but the new one passed all checks!

Now, let’s take a look at the database. Following query returned two rows, that looked like an upper marker (1|zzzzzz:) and a lower marker (1|000000:). Both were associated with the field ID of the newly created ‘Rank2’ custom field.

select * from AO_60DB71_LEXORANK;

What I did was a very simple thing. I updated the field ID of the two records so they are now associated to the old Rank field.

update AO_60DB71_LEXORANK
set FIELD_ID = (select ID from CUSTOMFIELD where CFNAME = 'Rank');

commit;

Finally, to clean up I deleted the newly created Rank2 custom field. Simple!

After a JIRA restart Lexorank started to function normal, with all the integrity checks passed. I hope my approach will help someone who has run into the same problem.

Advertisements

[JIRA] Broken Permission Schemes? (better way)

Yesterday I blogged about how to fix JIRA Permission Schemes of a corrupted JIRA database. The observation was from atlassian-jira.log, but in my case I soon found out the problem was much greater in my case.

All projects lost their workflow scheme, issue type screen scheme, and field configuration scheme, and project category associations. This led me to peek into the database directly. The NODEASSOCIATION table had only 20 – 30 rows – those are the permission schemes I fixed yesterday. Also, all issues lost their components, affected versions and fix versions.

So how do I fix this? I can fix issue type screen scheme association without a hassle, notification schemes without a hassle, but workflow schemes? Even automating the restoration may run into dead ends given the nature of steps of workflow scheme association through UI. The only option seemed to be restore the corresponding records to NODEASSOCIATION table from the most recent database backup.

This is actually safer than meddling with other database tables in JIRA, because NODEASSOCIATION has no primary key, so no chance of primary key violation errors after starting up JIRA. With all sounded good, here’s my steps.

  1. From the most recent backup of the same JIRA instance, export the NODEASSOCIATION table. With Oracle SQL Developer there’s an option to export records in ‘INSERT’ format, which generates a SQL script.
    • If you use another database/ client that can’t export into ‘INSERT’ format, you can export to a CSV or spreadsheet and then use spreadsheet formulae to generate INSERT queries.
    • In my case I had to exclude where SINK_NODE_ENTITY = ‘PermissionScheme’ because I’ve already fixed that.
  2. In the target JIRA database, run the above SQL script and commit. Easy! 😀
  3. Restart JIRA and re-index.

This added some 60,000+ records with all entity association you’ll find out with this query:

select distinct source_node_entity, sink_node_entity, association_type from nodeassociation order by 1 asc;

That’s it! Not 100%, but this worked up to my expectation. The key reason for this being hassle-free and easy is, NODEASSOCIATION table has no primary key. This is actually much much better than using Groovy, because you have to pay for the add-on. 🙂

[JIRA] Broken Permission Schemes?

Edit (24 May): Spoiler alert! There’s a better way.

I came across a corrupted JIRA database with all projects lost their permission schemes.

From the database, I believe this happens when corresponding records were deleted from the NODEASSOCIATION table. Whatever the cause is, you’ll notice the following log entry in atlassian-jira.log when this happens:

2017-05-23 02:57:18,363 WARN [permission.DefaultPermissionSchemeManager]: No permission scheme is associated with project ''

The problem is, (in JIRA 7.1.x) when you navigate to Project Administration –> Permissions to associate it with a scheme, you’ll see an empty page. For a newly created project Default Permission Scheme should show up, but now it absolutely has no permission scheme. It’s lost.

So, here’s the expensive but easy solution. Use the Script Runner add-on. Execute this Groovy code in the script console and it will fix everything in a minute!

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.bc.project.ProjectService;
import com.atlassian.jira.bc.project.ProjectService.UpdateProjectSchemesValidationResult;

def projectService = ComponentManager.getComponent(ProjectService.class);
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();

Long permissionSchemeId = 10000; // ID of the permission scheme that you wish to associate to each project
Long notificationSchemeId = null;
Long issueSecuritySchemeId = null;
ProjectService.UpdateProjectSchemesValidationResult validationResult = projectService.validateUpdateProjectSchemes(currentUser, permissionSchemeId, notificationSchemeId, issueSecuritySchemeId);

ComponentAccessor.getProjectManager().getProjectObjects().each {
  projectService.updateProjectSchemes(validationResult, it);
}

As it can be understood from the code, you can fix Notification Schemes and Issue Security Schemes using the same way.

Do crashbars protect your legs?

I am a motorcycle rider who encountered with a number motorcycle accidents and still in one piece.

Being a high speed fanatic, I read more and more about motorcycle safety following each accident. I explored ways to avoid trouble without losing the thrill of speed. As motorcycle training in Sri Lanka doesn’t commence in a professional way, most of the motorcycle riders have just a set of self-taught incomplete skills and beliefs.

When reading about motorcycle safety online I found a quite interesting thing called the “Hurt Report”. I’m not sure how far these findings of the Hurt Report are valid in Sri Lanka — and practically I experienced that the finding about crashbars isn’t quite true. Well, at least not for me.

It says,

Crash bars are not an effective injury countermeasure; the reduction of injury to the ankle-foot is balanced by increase of injury to the thigh-upper leg, knee, and lower leg.

So what does my experience say? I had a 150 cc Hero Honda Hunk (2011 model). In Sri Lanka it’s an average intermediate level motorcycle with a considerable body weight. When I ride I usually keep my legs close, each in tight contact with the fuel tank. In one of the two encounters where crashbars involved, right side crashbar bent due to direct impact with road surface. I decided to repair it instead of buying a new one – and voilà – it was not only bent, but also fractured!

I have seen many motorcycle owners ride bikes with crashbars just bent due to previous accidents, but this was the first time I saw one actually bent and cracked.

Now, imagine what could have happened to my kneecap if there was no crashbar and I kept my legs open! It’s a horrific feeling. Crashbars do protect – but also important to have your legs closed.

How I use Facebook on Android

Once installed their app, Facebook thinks they own our mobile devices.

At first, there was the peaceful all-purpose Facebook app. And some time later they separated messaging into another app, creating the Messenger. Initially it was at user’s discretion to use Messenger or Facebook app for messaging. Initially it looked polite but lately everyone was gradually forced to install Messenger. Another app… sigh! Personally, for me messaging is just messaging. I don’t want a childlike fairyland for just sending and receiving messages.

It didn’t stop there. Facecbook took unfair advantage of Samsung TouchWiz feature for displaying notification count on the app icon. When there are unread messages, Facebook app will add that up to notification count, forcing your mind to install the Messenger (or read them on computer to clear notifications).

And now it has come down to infiltrating our privacy through social engineering.

After all these took place, finally something is here that we can thank Facebook for. that is called Messenger Lite. That helps, because I don’t have to install that monstrous Messenger app just to read and send a line on the go. With Facebook app and Messenger Lite installed, here’s how I get maximum use of Facebook without letting it use me and eat up my phone.

Zero notifications

Go to Facebook app settings –> Notifications, and simply turn them all off at once. Who wants to be disturbed for every single Like and comment during an important office meeting?

Who wants fancy sounds?

Settings –> Sounds in the App – Turn it off. Just because I don’t want others to know that I’m using Facebook during a boring office meeting too!

Privacy of your contacts could be your responsibility too

Settings –> Continuous Contacts Upload – Turn it off.

I don’t want to be disturbed by every single new message

Go to Messenger Lite –> Notifications & Sounds.

Notifications: on. Notification previews: off. Vibrate: off. Light: on. Sound: off.

Now, one last thing. Messenger Lite app icon on GoogleNow launcher goes as just “Lite” that’s absurd (they think Messenger Lite is the only lite app?). Now I found a cool app called QuickShortcutMaker which will do the trick (you’ll figure out how to use it). I created a custom icon named “Messenger Lite” and removed the one placed by the official app installer. Now, all set.

However, these are my personal settings. Setting that prevent me from wasting too much attention on Facebook, making me use it only when needed. These settings may not work for you as-is, but I think it provides you with a good suggestion.

Why should you see a doc

Recently I encountered a little accident and thought I should keep this little note written somewhere. We, Sri Lankan are usually reluctant to go for medical advice when damage appears to be small. “Ah.. it’s nothing. It’ll heal.”, is it? We get most of our medical expenses covered by the government, and for these little things we are less likely to spend a night or two at hospital.

As soon I encountered the scene I rushed to the hospital because I was afraid of serious internal damage to my hand, though the wound looked like just a deep puncture and swelling caused by it. Even few people told me there’s nothing to be afraid of. X-ray was taken and doctors concluded no tendon damage (they took X-ray for a reason, isn’t it?). An overnight hospital stay for free!

Before I am discharged from the hospital I met another man who came to visit a patient. His piece gave me the motivation to write this little note. When he clench his hand, little finger (pinky) stops halfway. It won’t clench unless external force is applied, and when released it will pop back to the previous position as if it was spring loaded.

“What happened?”

“Couple of years ago two of my fingers were accidentally cut by a knife. I went to the local hospital. Doctors wanted to transfer me to base hospital. I refused and told them this is just a minor wound, so basic treatments will do.”

After arguing with doctors, the man had discharged at will. And sustained permanent dysfunction of his little finger. A stupid trade-off when you get everything for free.

If you encounter a physical injury despite of its seriousness appearing to you from outside, see a doctor. Give them as much as information, not instructions.

What now, Mobitel?

Recently I wrote about Mobitel LiveScreen because I was unhappy about the experience.

As soon I published that on my Facebook page (850+ likes), it instantly took vast public attention. So far it reached 13,000+ people without targeted advertising. Given my page’s member base is small, the post made a significant reach. Unless advertised none of my other blog posts ever reached more than 500 people on average. By the time of this writing, I’ve seen more people have started to voice against VAS scams which is a good trend.

Get the message, Mobitel? Lots of people think that you violate proper business etiquette.

Mobitel staff may think I’m a douchebag, but I am certainly not that type. I am a loyal customer who always appreciate quality service (examples available). But when it comes to daylight robbery, I can turn into a real pain-in-ass customer. From the feedback I received from readers, I realize that every Sri Lanakn telco is playing this dirty game.

So, what now, if Mobitel (and other telcos) care to listen?

Value Added Services (VAS) in Sri Lankan telco industry probably have a history over more than 10 years (history that I know of). At that time the devices we used had limited capabilities. GPRS for Internet. No Viber/ WhatsApp/ SnapChat. WAP played God. SMS and MMS ruled.

In that era, downloading a celebrity’s portrait and setting it as phone’s screen background was a real deal. Now some people might be thinking, why can’t you simply download it, crop it by yourself and then set as wallpaper? There were several real world problems with that.

That problems enabled telcos to make some extra profit out of a wallpaper and ringtone business through WAP sites. I remember people used to download wallpapers, ringtones, and even games through WAP sites. It didn’t end up there. Content such as jokes, astrology, religious prayers were delivered to subscribers’ phones as SMS at a fee. This used to be a service that people wanted.

Now it’s 2016. We have Android that supercharged the mobile phone users. Most have smartphones. We have Google that will get us what we need effortlessly. Facebook has a lot of memes that you can enjoy. Lot of free and paid games are out there in Google Play. Almost everything is available for free. Zedge has a plethora of wallpapers and ringtones.

Do customers still want WAP-based entertainment sites? I don’t think so. That era is gone. Unfortunately, telcos such as Mobitel and Etisalat don’t seem to realize this. Or rather, they pretend to be not seeing it. Instead of striving to deliver value to the customer, they desperately attempt to hard-sell the same WAP content – just like Darley road car accessory traders do.

How?

  1. By unsolicited activation of LiveScreen on newly purchased/ replaced SIM cards. These pop ups appear intermittently in a way that ‘OK’ button (meaning ‘I Agree’) could be unintentionally touched.
  2. By directly exposing our accounts to third party content providers to bill us as they wish. So, if a pop-up ad in a web page is touched accidentally, you don’t even know but they bill us on the spot.

(I can provide more detailed logical explanations on why this is not gentlemanly – if you happen to lack of common sense)

Are these telcos too lazy to innovate?

As a customer, I do not see why should I pay Rs. 30/ month to get home remedies via SMS. There is a plenty of Facebook pages that offer the same for free. I do not see why should I pay a WAP site to download pictures of a fashion model when Google gets me there for free. Rather than investing in an innovative service that delivers what customer needs, these telcos have totally ditched the sales etiquette, and they trade off their brand reputation for unsolicited VAS subscriptions.

Telcos,

Why don’t you do some market research to identify what kind of devices people use? I hardly think Android users who have subscribed to mobile data-included packages will have any interest in jokes via SMS. Why can’t you do a little market research to understand what people actually need? I have absolutely no interest in what happens around Bollywood, but there are other things that I’m interested in. As a busy worker, I’d rather be interested in things like road traffic alerts, train delays, freelancing opportunities, etc. Also, it’s worth understanding that SMS is only good for things that need urgent attention, such as breaking news alerts and job search.

Just think about your brand reputation and what customers are ought to do about this next. No more daylight robbery, please.