Wiki source code of Busting the Work Confluence
Last modified by Normann P. Nielsen on 2025/12/12 15:11
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | Thursday night on the couch, having a day off friday, I decided to do some layout work on the Confluence we use at my workplace (just for the fun of it, as my work is my hobby - sort of anyway). | ||
| 2 | |||
| 3 | I had created a new User Macro, that I wanted to implement on the Dashboard, so I started editing in the Global Layouts in Confluence to place it on the Dashboard: | ||
| 4 | |||
| 5 | [[image:Screen Shot 2014-02-02 at 20.01.39.jpg||width="842"||height="296"]] | ||
| 6 | |||
| 7 | As part of the changing of the Dashboard code, I entered: | ||
| 8 | |||
| 9 | |||
| 10 | {{code}} | ||
| 11 | {html}<font size="4">Space Quick Select</font>{html} | ||
| 12 | {{/code}} | ||
| 13 | |||
| 14 | pressed "Save" and: | ||
| 15 | |||
| 16 | [[image:bam_logo.jpg]] | ||
| 17 | |||
| 18 | the Confluence went down - just giving me a "Service Unavailable" from the Traffic Manager. | ||
| 19 | |||
| 20 | Shit, I restarted the instance- no improvement.....so starting to diagnose: | ||
| 21 | |||
| 22 | |||
| 23 | {{code}} | ||
| 24 | npn@docs01:~$ wget -O - localhost:8080 | ||
| 25 | --2014-01-30 21:46:27-- http://localhost:8080/ | ||
| 26 | Resolving localhost... ::1, 127.0.0.1 | ||
| 27 | Connecting to localhost|::1|:8080... connected. | ||
| 28 | HTTP request sent, awaiting response... 500 Internal Server Error | ||
| 29 | 2014-01-30 21:46:28 ERROR 500: Internal Server Error. | ||
| 30 | |||
| 31 | npn@docs01:~$ | ||
| 32 | {{/code}} | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | Hm, error 500, diagnosting further: | ||
| 37 | |||
| 38 | |||
| 39 | {{code}} | ||
| 40 | root@docs01:/pack/confluence-data/logs# tail -f atlassian-confluence.log | ||
| 41 | caused by: java.lang.RuntimeException: Error rendering template for decorator global | ||
| 42 | at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:186) | ||
| 43 | caused by: org.apache.velocity.exception.ParseErrorException: Encountered "4" at /decorators/global.vmd[line 38, column 87] | ||
| 44 | Was expecting one of: | ||
| 45 | "," ... | ||
| 46 | ")" ... | ||
| 47 | <WHITESPACE> ... | ||
| 48 | |||
| 49 | at org.apache.velocity.Template.process(Template.java:141) | ||
| 50 | {{/code}} | ||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | So, It seems the code I put in the Global layout makes the Confluence crash totally, not just rendering the Dashboard, but TOTALLY!!! | ||
| 55 | |||
| 56 | I fired up for MySQL and looked at the DECORATORS table: | ||
| 57 | |||
| 58 | |||
| 59 | {{code}} | ||
| 60 | mysql> select DECORATORID,DECORATORNAME FROM DECORATOR; | ||
| 61 | +-------------+-----------------------+ | ||
| 62 | | DECORATORID | DECORATORNAME | | ||
| 63 | +-------------+-----------------------+ | ||
| 64 | | 64913409 | decorators/global.vmd | | ||
| 65 | | 48300036 | decorators/page.vmd | | ||
| 66 | | 59080705 | decorators/page.vmd | | ||
| 67 | +-------------+-----------------------+ | ||
| 68 | 3 rows in set (0.00 sec) | ||
| 69 | |||
| 70 | mysql> | ||
| 71 | {{/code}} | ||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | Now, 2 choises are available: | ||
| 76 | |||
| 77 | 1. Fix It | ||
| 78 | 1. Delete the DECORATORID=64913409 record. | ||
| 79 | All though I am pretty sure number 2 works (same as using "Reset Default"), I went for number 1: | ||
| 80 | |||
| 81 | |||
| 82 | |||
| 83 | First, I shut down Confluence completely. | ||
| 84 | |||
| 85 | Then I made a complete dump of the Confluence Database: | ||
| 86 | |||
| 87 | |||
| 88 | {{code}} | ||
| 89 | mysqldump -uconfluence -p confluence > confluence.sql | ||
| 90 | {{/code}} | ||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | After securing the backup, I dumped the DECORATOR table: | ||
| 95 | |||
| 96 | |||
| 97 | {{code}} | ||
| 98 | mysqldump -uconfluence -p confluence DECORATOR > DECORATOR.sql | ||
| 99 | {{/code}} | ||
| 100 | |||
| 101 | |||
| 102 | |||
| 103 | After that, I changed the DECORATOR.sql file i the "vim" editor - stripping off everything but the record for DECORATORID=64913409, and change the "INSERT INTO" to an "UPDATE" so it looked like: | ||
| 104 | |||
| 105 | |||
| 106 | {{code}} | ||
| 107 | UPDATE DECORATORS SET body='### ...code...code...code.' WHERE DECORATORID=64913409 | ||
| 108 | {{/code}} | ||
| 109 | |||
| 110 | And the whole point being that I removed the "{html}<font size=\"4\">Space Quick Select</font>{html}" from the body code. | ||
| 111 | |||
| 112 | |||
| 113 | |||
| 114 | Finally, I put back the decorator: | ||
| 115 | |||
| 116 | |||
| 117 | {{code}} | ||
| 118 | mysql -uconfluence -p confluence < DECORATOR.sql | ||
| 119 | {{/code}} | ||
| 120 | |||
| 121 | |||
| 122 | |||
| 123 | And started the Confluence Instance: | ||
| 124 | |||
| 125 | |||
| 126 | |||
| 127 | [[image:success.jpg||width="300"]] | ||
| 128 | |||
| 129 | - up and running again |