This tip is for people using the Copy Space plugin on Confluence wiki. If you’re copying a large space, you may see an HTTP 500 or HTTP 504 server error a few minutes after starting the space copy. Don’t panic. It’s likely that the copy process is still going on. Whatever you do, don’t close the browser tab or window until you know for sure.
It happens to me often, and it happened in a rather spectacular fashion earlier this week. I’m letting you know, in the hope that I can save you from a moment of panic. Or, as in my case this week, from a few hours of unnecessary frenzy.
About the HTTP 500 and HTTP 504 errors
When you get an HTTP 500 error, your browser window displays a message something like this:
- 500 Internal Server Error
- Internal Server Error
- HTTP Error 500
The error message is a bit useless. It doesn’t give you much information, and it sounds very dire. Basically, it means that something has gone wrong and the server can’t give you more information. This is the error we get when using the Copy Space plugin on our production documentation wiki.
I’ve also seen an HTTP 504 error appearing in the same situation on a test server. It seems that the server configuration determines which error you get. HTTP 504 is a Gateway Timeout error. That’s a bit more helpful and a little less scary.
What to do if you get an HTTP 500 or 504 while copying a space
First, wait a while. It is most likely that the front end has timed out, but the copy process is still happening in the background. Do not close down your browser.
Open another browser window or tab, and try going to the address of your new space. The space will become available when the copy operation has finished. Keep trying.
How long should you wait? Ah, now there’s the rub. The copy operation can take anything from a few minutes to a few hours, depending on the size of your space. Until this week, I would have said 2 hours was the maximum time to wait. This week, one of our spaces took 5 hours to copy. I guess the answer is: It depends on your previous experience with copying spaces on your wiki.
When the waiting period has gone on too long, raise the alarm with your system administrators. Ask them to examine the logs to see what has happened, and to determine whether the process is still running.
If you have no joy there, start the copy process again.
What is the Copy Space plugin?
The Copy Space plugin is an add-on that you can install into your Confluence wiki. It gives you a way to copy the content of a space to a new space, with a new space key. One of the Confluence developers wrote this plugin for the Atlassian technical writers, and it’s available for everyone else to use too. It is not a supported plugin, but we use it all the time. It would be very difficult to do without it.
There’s a request for the Copy Space plugin to be supported and bundled with Confluence: CONF-14198. If you like, you can vote for and comment on the issue. If the plugin were supported and bundled, we could ask for better handling of long-running tasks.🙂
I love the colours of this Banksia flower I saw when walking in the Australian bush. The flower head is made up of hundred of tiny individual flowers. (Ref.) Perhaps 500, or even 504?😉
Last week I used the Copy Space plugin to create an archive of the Confluence 3.1 documentation, because we’ll be releasing Confluence 3.2 very soon. I ran into a problem when the space copying procedure encountered a fairly old Gliffy diagram. It’s possible that you may hit the same problem next time you use the Confluence Copy Space plugin. Here’s the workaround.
In short: Open the offending diagram in the Gliffy editor and then save it again. There’s no need to make any changes. Start the space copying procedure again. You’ll need to do this for each diagram that triggers the error.
A bit of background
We write and publish our technical documentation on Confluence wiki, and we use wiki spaces as the mechanism for version control. For each major release of the software that we’re documenting, we create a separate space containing the documentation specific to that version. We use the Copy Space plugin to copy the current documentation into a new space. I’ve written more about this procedure in an earlier blog post. (A by the way: Atlassian support does not cover the Copy Space plugin — but we use it.)
So last week I started the Copy Space plugin and hit a problem.
The space copying procedure runs for a while and then stops. The log files show an error message something like this:
…CopySpaceException: An error occurred while copying an attachment…. AttachmentDataStreamSizeMismatchException: Attachment data stream contains a different number of bytes to the declared size of the attachment.
If you have the very latest version of the Copy Space plugin, you will see a nice neat error message on the screen, including a link to the offending diagram:
Here’s the text of the above error message:
An error occurred while copying the space. The copy was cancelled.
The content that could not be copied was titled: <Gliffy image name>. link
The attachment’s size property does not match the attachement’s data size: Attachment: <Gliffy image name, version, attachment ID and author’s username>
Unfortunately, earlier versions of the Copy Space plugin don’t give such a useful error.
If you like, you can take a look at the bug report too.
The problem seems to happen for old diagrams only. (I encountered 3 such diagrams when copying the Confluence documentation this week.)
The workaround is simple: Open the offending diagram in the Gliffy editor and then save it again. There’s no need to make any changes to the diagram. If you have the latest version of the Copy Space plugin (version 1.2) the error even includes a link to the offending Gliffy diagram.
Start the space copying procedure again.
You’ll need to do this for each diagram that triggers the error.
I’m using these versions of the software:
- Confluence 3.2-rc1 (release candidate 1)
- Copy Space plugin 1.2
- Gliffy plugin 2.0.2-RC2