You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hello,
After upgrade from 8.0.4 to 8.1.0
I have following errors.
javax.servlet.ServletException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHeaderLogo' in class net.getunik.confluence.skin.core.logo.VelocityLogoHelper threw exception org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at /net/getunik/confluence/skin/core/theme/templates/includes/logo.vm[line 10, column 46]
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHeaderLogo' in class net.getunik.confluence.skin.core.logo.VelocityLogoHelper threw exception org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at /net/getunik/confluence/skin/core/theme/templates/includes/logo.vm[line 10, column 46]
Invocation of method 'getHeaderLogo' in class net.getunik.confluence.skin.core.logo.VelocityLogoHelper threw exception org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at /net/getunik/confluence/skin/core/theme/templates/includes/logo.vm[line 10, column 46]
query did not return a unique result: 2
I understand that I have to delete an extra entry in the table, but in which table exactly?
Need help.
Hello,
Thank you for your help.
Yes. I use third party theme plugin.
Enterprise Theme for Confluence.
But if I disable (I was try disable all plugins) it, I have the same error.
Yes, I think too, that plugin trouble, but, I think, I have to remove incorrect record in table. I don't see other way.
Then you couldn't have disabled it correctly, because if a plugin is disabled, Confluence wouldn't incur any of it's code. Either that, or you got a different error.
Following up on my last comment, the duplicate is somewhere in bandana, this should filter it out
SELECT bandanacontext, bandanakey, COUNT(bandanakey) FROM bandana GROUP BY bandanacontext, bandanakey HAVING COUNT(bandanakey) > 1;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do not help.
All records have COUNT 1.
I try upgrade to 8.1.3 and get more information:
javax.servlet.ServletException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHeaderLogo' in class net.getunik.confluence.skin.core.logo.VelocityLogoHelper threw exception org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at /net/getunik/confluence/skin/core/theme/templates/includes/logo.vm[line 10, column 46]
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHeaderLogo' in class net.getunik.confluence.skin.core.logo.VelocityLogoHelper threw exception org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at /net/getunik/confluence/skin/core/theme/templates/includes/logo.vm[line 10, column 46]
Invocation of method 'getHeaderLogo' in class net.getunik.confluence.skin.core.logo.VelocityLogoHelper threw exception org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at /net/getunik/confluence/skin/core/theme/templates/includes/logo.vm[line 10, column 46]
query did not return a unique result: 2
Yes. This is plugin trouble but I can't find duplicate record.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, strange. Okay, so I took another look, without the stacktrace it is a guess, but I'm 99% sure this time it's this:
SELECT * FROM content WHERE contenttype = 'GLOBALDESCRIPTION';
If that 1% of chance is wrong, this really sounds like something to take up with the vendor, but I'm pretty sure this will be it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thank you for your help.
Yes I found 2 records.
contentid | hibernateversion | contenttype | title | lowertitle | version | creator | creationdate | lastmodifier | lastmoddate |
-----------+------------------+-------------------+-------+------------+---------+---------+---------------------+--------------+---------------------+--
1 | 0 | GLOBALDESCRIPTION | | | 1 | | 2012-05-29 05:29:12 | | 2012-05-29 05:29:12 |
425986 | 0 | GLOBALDESCRIPTION | | | 1 | | 2009-09-03 15:15:34 | | 2009-09-03 15:15:34 |
Seems to be wrong with record 425986.
But I can not delete it.
error the same like:
https://jira.atlassian.com/browse/CONFCLOUD-75221
DELETE FROM content WHERE contentid = '425986';
ERROR: update or delete on table "content" violates foreign key constraint "fkwjyn6091q3l1gl7bh143ma2a" on table "content"
DETAIL: Key (contentid)=(425986) is still referenced from table "content".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, you can disable foreign key entries so you can delete it, but better to check all of the referenced tables/columns before doing so to avoid breaking something. That error message is a bit funny, sounds to me like it references itself, so maybe if you're lucky you could remove that foreign key, try to delete, then add the foreign key back. Worst case would need to check all the referenced tables and columns to ensure some orphaned row doesn't stay behind. I'm no DBA, but there should be some guides how to do that, or Atlassian KBA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes.
You were right.
I removed the extra line and it worked.
Thanks for the help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
net.getunik.confluence*
This does not appear to be native package. Do you have any custom Theme related plugin(s)? If so, I'd probably try to start Confluence with the plugins disabled on startup:
# https://confluence.atlassian.com/confkb/how-to-manually-remove-malfunctioning-add-ons-113705118.html
Which should be similar to
$ ./start-confluence.sh --disable-addons=com.atlassian.test.plugin
That said, without knowing which plugin this is, probably my next step would be to list all tables in database and find something resembling themes/logos (which will start with AO_xxx_).
According to https://jira.atlassian.com/browse/CONFSERVER-53140 the plugin is this: https://marketplace.atlassian.com/apps/1211252/enterprise-theme-for-confluence?hosting=server&tab=overview
The plugin's key is 'net.getunik.confluence.skin.core' (to disable on startup)
I'd assume that perhaps you didn't upgrade the plugin before the upgrade (https://marketplace.atlassian.com/apps/1211252/enterprise-theme-for-confluence/version-history).
So overall, I'd start up Confluence with the plugin disabled, once booted up, update the plugin in UPM, and probably that should work, without needing to manually delete something in the db. If it still fails and you see the same errors in the log, while trying to update it, then I cannot preach about deleting stuff, officially would reach out to the vendor.
Edit:
Offending line in vm:
#set($logo = $enterpriseThemeLogoManager.getHeaderLogo($spaceKeyOrUsername))
In java:
public Logo getHeaderLogo(String spaceKeyOrUsername) {
return this.getHeaderLogo(spaceKeyOrUsername, AuthenticatedUserThreadLocal.get());
}
next to
public Logo getHeaderLogo(String spaceKeyOrUsername, ConfluenceUser currentUser) {
Logo logo = null;
ThemeConfigurationMap themeConfiguration = this.themeConfigurationManager.getThemeConfiguration(spaceKeyOrUsername);
Boolean showSpaceLogo = !themeConfiguration.isTrue("true_false_header_show_global_logo");
if (showSpaceLogo) {
logo = this.getSpaceLogo(spaceKeyOrUsername, currentUser);
}
if (logo == null) {
logo = this.getConfluenceLogo();
}
return logo;
}
(And here I kind of gave up because I'd need the stacktrace to know the steps to follow in here what is the exact offending method).
Long story short this uses https://docs.atlassian.com/atlassian-bandana/3.1/apidocs/com/atlassian/bandana/BandanaManager.html
Delving into https://developer.atlassian.com/server/confluence/persistence-in-confluence we come to find that the plugin stores data in 'BANDANA' table.
So would look into BANDANA for anything containing '%net.getunik%' and chances are the duplicate is somewhere in there.
Anyhoo, just first steps I'd try, but again, would talk to the vendor before destroying the db by accident.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.