Wednesday, December 5, 2012

Importing Project from JIRA OnDemand to Standalone

This week I had to import some projects from JIRA OnDemand (atlassian.net) into our company Standalone JIRA.

OnDemand JIRA Version: 6.0-OD-01

Standalone JIRA Version: v5.2.1#813

Frist, I took a full backup using JIRA Backup Manager on the source JIRA and copied over on the Standalone server to .\Appdata\JIRA\import.

Then went to System -> Import & Export -> Project Import where the fun began.

This data appears to be from an older version of JIRA. Please upgrade the data and try again. The current version of JIRA is at build number '813', but the supplied backup file was for build number '6001'.

JIRA OnDemand is always a little bit newer than the Standalone released version, but the problem is that JIRA thinks the two backups are uncompatible. To correct this, I had to edit the entities.xml file from the backup. Actually, there's a lot of work in that file so what I did is I deleted the "data" folder from the archive so the extract - repack will go smoother. I used Total Commander to open the zip because it allows to edit the file directly in the archive. Configured Notepad++ as the editor because it's faster on large files than Windows Notepad.

To hack the version, I had to find this:

<OSPropertyString id="10047" value="6001"/>

and replace with

<OSPropertyString id="10047" value="813"/>

The next problem was with the plugins, which were also newer on the source JIRA.

The backup project 'IPM' requires custom field named 
'Rank' with full key 'com.pyxis.greenhopper.jira:gh-global-rank'. In the current 
instance of JIRA the plugin is at version '6.0.8', but in the backup it is at 
version '6.0.8-rc2'. 

The backup project 'IPM' requires custom field named 'Release Version History' with full key 'com.pyxis.greenhopper.jira:greenhopper-releasedmultiversionhistory'. In the current instance of JIRA the plugin is at version '6.0.8', but in the backup it is at version '6.0.8-rc2'.
The backup project 'IPM' requires custom field named 'Sprint' with full key 'com.pyxis.greenhopper.jira:gh-sprint'. In the current instance of JIRA the plugin is at version '6.0.8', but in the backup it is at version '6.0.8-rc2'.
The backup project 'IPM' requires custom field named '[CHART] Date of First Response' with full key 'com.atlassian.jira.ext.charting:firstresponsedate'. In the current instance of JIRA the plugin is at version '1.10', but in the backup it is at version '1.10.4'.
The backup project 'IPM' requires custom field named '[CHART] Time in Status' with full key 'com.atlassian.jira.ext.charting:timeinstatus'. In the current instance of JIRA the plugin is at version '1.10', but in the backup it is at version '1.10.4'.

Being lazy, what I did is searched for all instances of "6.0.8-rc2" and replaced with "6.0.8" (including the quotes) in entities.xml, being the latest public Greenhopper version. Same with "1.10.4" -> "1.10"

The next issue was with user mapping. The users at atlassian.net had different usernames then in Active Directory. JIRA gave me the list of users that have this problem, and I had to update entities.xml for each of them. So I searched for example for "lrog" and changed in "levente.rog" that corresponds to the username in AD. Repeated that for all problematic users.

I could have done the same with the mismatching groups, but I'll just manually assign roles for the new groups after the project import.

There were some unresolved issues left:

The custom field 'Billing Key' will not be imported because the custom field type 'is.origo.jira.tempo-plugin:billingKeys' is not installed.

We are not using the Tempo plugin so I'll just ignore this error message


Unable to import custom field '[CHART] Time in Status'. The custom field type does not support project imports.

Not sure where that comes from


Unable to import custom field 'Sprint'. The custom field type does not support project imports.

That's a big issue, not sure how am I going to solve this. JIRA-28748 is tracking this but that's not a big help at the present.

Tuesday, November 27, 2012

JIRA not working in Internet Explorer - JS errors

After upgrading to the lastest version of JIRA (5.2) some users reported that they get errors in Internet Explorer and JIRA is unusable.
The error they saw:

Full error message:
======== Start error log ==========
 
Webpage error details
 
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; .NET CLR 1.1.4322)
Timestamp: Tue, 27 Nov 2012 09:53:17 UTC
 
 
Message: 'window.Raphael.svg' is null or not an object
Line: 20
Char: 1
Code: 0
URI: https://jira/s/en_USjgiham-418945332/812/95/1/_/download/superbatch/js/batch.js
 
 
Message: 'JIRA.FormDialog' is null or not an object
Line: 1
Char: 13
Code: 0
URI: https://jira/s/en_USjgiham-418945332/812/95/0fe07bcec0e611fd1ab0042e98d11ba6/_/download/contextbatch/js/atl.general/batch.js
 
 
Message: 'JIRA' is null or not an object
Line: 1
Char: 1
Code: 0
URI: https://jira/s/en_USjgiham-418945332/812/95/1.0/_/download/batch/jira.webresources:group-pickers/jira.webresources:group-pickers.js
 
 
Message: 'JIRA' is null or not an object
Line: 1
Char: 14
Code: 0
URI: https://jira/s/en_USjgiham-418945332/812/95/1.0/_/download/batch/jira.webresources:user-pickers/jira.webresources:user-pickers.js
 
 
Message: 'AJS.MultiSelect' is null or not an object
Line: 35
Char: 1
Code: 0
URI: https://jira/s/en_USjgiham-418945332/812/95/1.0/_/download/batch/jira.webresources:jira-fields/jira.webresources:jira-fields.js
 
 
Message: Object doesn't support this property or method
Line: 1
Char: 1
Code: 0
URI: https://jira/s/en_USjgiham-418945332/812/95/1.0.54/_/download/batch/com.atlassian.jira.jira-quick-edit-plugin:quick-form/com.atlassian.jira.jira-quick-edit-plugin:quick-form.js
 
 
Message: 'JIRA.Forms' is null or not an object
Line: 1
Char: 1
Code: 0
URI: https://jira/s/en_USjgiham-418945332/812/95/1.0.54/_/download/batch/com.atlassian.jira.jira-quick-edit-plugin:quick-create-issue/com.atlassian.jira.jira-quick-edit-plugin:quick-create-issue.js
 
 
Message: 'jira.app' is null or not an object
Line: 85
Char: 5
Code: 0
URI: https://jira/s/en_USjgiham-418945332/812/95/1.1.1/_/download/batch/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources.js
 
 
======== End error log =========

Solution:
The easiest solution is adding the website to IE's trusted sites' list.
The particular setting that causes the problem is in Internet Options -> Security -> Custom Level -> ActiveX controls and plug-ins -> Binary and script behaviors is not Enabled.

Friday, November 16, 2012

MySQL 5.5 service won't start: Job failed to start

Trying to connect to my local MySQL 5.5 on an Ubuntu Server 12.10 x64 gave me the following error:

   levente@linuxvm:/$ mysql
   ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Turned out that the MySQL Service is not running.

   levente@linuxvm:/$ ps -ef | grep mysql
   levente 5347 2842 0 08:47 pts/1 00:00:00 grep --color=auto mysql

Trying to start it failed:

   levente@linuxvm:/var/log$ sudo service mysql start
   start: Job failed to start

Syslog shows like this:

   levente@linuxvm:/$ cat /var/log/syslog
   Nov 16 08:28:49 linuxvm kernel: [ 1307.007001] type=1400 audit(1353072529.161:42): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4600 comm="apparmor_parser"
   Nov 16 08:28:50 linuxvm kernel: [ 1308.658583] init: mysql main process (4604) terminated with status 1
   Nov 16 08:28:50 linuxvm kernel: [ 1308.658625] init: mysql main process ended, respawning
   Nov 16 08:28:51 linuxvm kernel: [ 1309.291148] init: mysql post-start process (4605) terminated with status 1
   Nov 16 08:28:51 linuxvm kernel: [ 1309.306516] type=1400 audit(1353072531.461:43): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4651 comm="apparmor_parser"
   Nov 16 08:28:52 linuxvm kernel: [ 1310.791380] init: mysql main process (4655) terminated with status 1
   Nov 16 08:28:52 linuxvm kernel: [ 1310.791400] init: mysql main process ended, respawning
   Nov 16 08:28:53 linuxvm kernel: [ 1311.380212] init: mysql post-start process (4656) terminated with status 1
   Nov 16 08:28:53 linuxvm kernel: [ 1311.395653] type=1400 audit(1353072533.549:44): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4702 comm="apparmor_parser"
   Nov 16 08:28:55 linuxvm kernel: [ 1312.886555] init: mysql main process (4706) terminated with status 1
   Nov 16 08:28:55 linuxvm kernel: [ 1312.886635] init: mysql respawning too fast, stopped


The problem is that I had some incorrect values in /etc/mysql/my.cnf. In my case it was an incorrect bind address that I just uncommented.

  #
  # Instead of skip-networking the default is now to listen only on
  # localhost which is more compatible and is not less secure.
  # bind-address = 172.17.1.1
  #
  levente@linuxvm:/$ sudo start mysql
  mysql start/running, process 5432

Yay!

Monday, November 12, 2012

Unexpected: Failed to get legacy traces

SharePoint Server 2010 Enterprise.

Checking the SharePoint Logs, found the following errors repeating each minute:


OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Timer Job job-diagnostics-io-intensive-query-provider)
OWSTIMER.EXE (0x17A8) 0x3264 Extended Diagnostic Providers SqlTrace Provider 2001 Unexpected Failed to get legacy traces
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Timer 6398 Critical The Execute method of job definition Microsoft.SharePoint.Diagnostics.SPIOIntensiveQueryDiagnosticProvider (ID c2f9c9c0-5d41-43a4-98bf-c59b007c3065) threw an exception. More information is included below. You do not have permission to run 'SP_TRACE_CREATE'.
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Timer 72ae Unexpected Exception stack trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Bo...
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Timer 72ae Unexpected ...olean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.SharePoint.Diagnostics.SqlTraceHelper.CreateTrace() at Microsoft.SharePoint.Diagnostics.SqlTraceStreamer.Init(SqlTraceParameters parameters) at Microsoft.SharePoint.Diagnostics.SPSqlTraceDiagnosticProvider.InitializeBackgroundThreads() at Microsoft.SharePoint.Diagnostics.SPSqlTraceDiagnosticProvider.Sync() at Microsoft.SharePoint.Diagnostics.SPDiagnosticsProvider.Execute(Guid targetInstanceId) at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTi...
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Timer 72ae Unexpected ...merService, Int32& result)
OWSTIMER.EXE (0x17A8) 0x3264 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Timer Job job-diagnostics-io-intensive-query-provider). Execution Time=9.3616

Solution:

Grant the user running the SharePoint 2010 Timer (SPTimerV4) service, which is usually the Farm account, serveradmin or sysadmin rights on the SQL Server. Then, restart the Timer service.

Explanation:

blogs.msdn.com/b/kaevans/archive/2012/02/09/sharepoint-error-6398-you-do-not-have-permission-to-run-sp-trace-create.aspx - great article!