Issue Details (XML | Word | Printable)

Key: CAL-247
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Ben Speakmon
Reporter: James Fleming
Votes: 5
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Confluence Calendar Plugin

Calendar plugin doesn't check whether it's referring to itself

Created: 27/Mar/08 11:54 PM   Updated: 27/Oct/08 01:07 PM
Component/s: iCalendar, {calendar}
Affects Version/s: 2.1.13, 2.6
Fix Version/s: 2.7.2

Time Tracking:
Not Specified

File Attachments: 1. Microsoft Word Calendar Issue.doc (101 kB)
2. Java Archive File calendar-plugin-2.6.2-SNAPSHOT.jar (1.05 MB)
3. Text File catalina.out_29thApr (2.26 MB)
4. Zip Archive catalina_07May2008.zip (170 kB)

Image Attachments:

1. CalendarErrorMay07.JPG
(115 kB)

2. Error while installing the plugin.jpg
(193 kB)

3. screenshot-1.jpg
(233 kB)

4. screenshot-2.jpg
(205 kB)

5. screenshot-3.jpg
(225 kB)

Labels:


 Description  « Hide
When a calendar is added using 'subscription', and is given its own URL as a target, an infinite loop results which brings down Confluence.
Encountered in CSP-17210. This involves a 2.2.6a server, so this may have been addressed since.

 All   Comments   Work Log   Change History   FishEye   Crucible   Builds      Sort Order: Ascending order - Click to sort in descending order
Anatoli Kazatchkov added a comment - 30/Mar/08 04:43 AM
I guess there is also a possibility of circular references like A -> B -> C -> A.


wiki-support@cisco.com added a comment - 02/Apr/08 06:49 AM
Hi Team,
We had faced this problem and it had caused our production system to go down every 10 to 15 mins.

This needs to be fixed asap.

We would request 2 alternatives
1.Disbaling subcription - how can we do that?
2.providing a patch fix for this as we have a widespread community using calendar. functionality.

A prompt fix/ patch would be very helpful.

Thanks and Regards
Wiki- Support (AP)


wiki-support@cisco.com added a comment - 08/Apr/08 02:56 AM
Hi Team,

Could you please look into this issue ASAP, any update on this issue would be very helpful. Please let us know if any update on this issue ASAP.

Best Regards
Wiki-Support(M)


Jonathan Nolen added a comment - 08/Apr/08 12:37 PM
Hi Cisco,

We're going to tackle this first thing tomorrow. Assuming the diagnosis is correct, we should have a fix for you shortly.

Thanks for working with us on this.

Cheers,
Jonathan


Ben Speakmon added a comment - 10/Apr/08 05:54 PM
I've attached a build of the calendar plugin. It contains a fix that will disallow the creation of subscriptions that refer to calendars on the same Confluence page as the one you're using. It is unchanged from the latest released version of the plugin otherwise.

Would you mind trying this in your Confluence install and confirming whether or not it addresses the issue?

Thanks!
--Ben


wiki-support@cisco.com added a comment - 14/Apr/08 02:23 AM - edited
Hi Ben,
We are getting an error while installing the plugin attached to the case.

I have the uploaded the screenshot of the error.

Please could you look into the same and give us the updated plugin ASAP.

Let me know if u need any other inputs from us.

Thanks and Regards
Wiki Support (AP)
Cisco


Soobaek Jang added a comment - 14/Apr/08 07:38 AM
Hi,
I am the original reporter for this problem. As stated at the ticket, we are using Confluence 2.2.6a, and getting error as Cisco is having.

Registers the iCalendar handler.
Error: There was a problem loading the descriptor for module 'listener' in plugin 'Calendar Plugin'. Error retrieving dependency of class: com.atlassian.confluence.extra.calendar.ical.ICalRegistrationListener. Missing class: com/atlassian/event/EventListener


Ben Speakmon added a comment - 14/Apr/08 12:50 PM
I'm looking at the problem; I'll post an update here when I have more news.

Ben Speakmon added a comment - 14/Apr/08 02:42 PM - edited
There was an incompatibility in the plugin API between Confluence 2.2.6a and 2.5.8 (which is where I was testing). The attachment called calendar-plugin-2.1.13.jar is from the same 2.1.13 source reported in the original issue and should perform properly on Confluence 2.2.6a. Soobaek, please let me know if it fixes your issue.

Cisco-Wiki, I'm investigating your issue based on your screenshot and will update you shortly.

Thanks!
--Ben


Ben Speakmon added a comment - 14/Apr/08 04:15 PM
Cisco-Wiki,

The problem you're having is due to an incompatibility between Lucene 1.9.1, which ships with Confluence 2.5.8, and Lucene 2.2.0, which began shipping with Confluence 2.7. Can you confirm for me that the screenshot came from Confluence 2.5.8 and that it's using the same version of lucene (1.9.1-atlassian) that it shipped with?


Soobaek Jang added a comment - 14/Apr/08 05:00 PM - edited
Ben,

It seems like working, but want to confirm one thing. When I subscribe itself page, I get the following error message.

Unable to read the calendar: Error at line 1: Expected [BEGIN], read [<!DOCTYPE HTML PUBLIC ]

Is it right one you have placed to resolve this issue?
I want to make sure I am resolve the issue that we have.

Thank you very much for your help!


wiki-support@cisco.com added a comment - 15/Apr/08 05:54 AM
Hi Ben,
Yes, we are using confluence 2.5.8 and it is using the same lucene-core-1.9.1-atlassian.jar

Please let me know the fix/ patch for the problem.

Let me know if you ned any other information.

Thanks and Regrads
Wiki Support (AP)
Cisco


Ben Speakmon added a comment - 16/Apr/08 12:05 PM
Cisco-Wiki,

I've attached another snapshot of the plugin. I've also verified that it installs correctly on my copy of Confluence 2.5.8. Can you try it out and let me know the results?

Thanks,
--Ben


Soobaek Jang added a comment - 16/Apr/08 12:07 PM
Ben,

Could you please confirm my question as well?
Thank you.


Ben Speakmon added a comment - 16/Apr/08 01:05 PM
Soobaek,

After rereading your question, I'm puzzled. The patched plugin disallows subscriptions to a calendar on the same Confluence page. But you're describing taking the page URL itself and trying to subscribe to that. Doing so definitely is an error, but it doesn't lead to any kind of infinite recursion for me in my testing with any version of the plugin. Are you saying that using the page's URL used to cause a hang for you and no longer does when using the snapshot I provided?


Soobaek Jang added a comment - 16/Apr/08 01:54 PM
Ben,

yes it did.
So to confirm what you have fixed, how can I try to subscript a calendar on the same page? What url would that be?


Ben Speakmon added a comment - 16/Apr/08 01:58 PM
If you click on the name of the calendar on the right side of the page, you'll see a link that says "Subscribe". That link is an automatically-generated webcal resource that you can use to subscribe to updates in that calendar from other webcal-capable applications like Sunbird, Evolution, Outlook, etc. The problem that I thought you were having was that if you created a subscription using the "Add Calendar" to that generated webcal resource from the original calendar an infinite regression would result. I was able to reproduce that problem in my testing. With the patch, this is now disallowed with an appropriate javascript error message.

Soobaek Jang added a comment - 16/Apr/08 02:28 PM
Okay, Thanks Ben.

We were using 2.1.13-h version.
That was due to last year's problem with UTC time zone not found problem with IBM JVM 1.4.
One I tested is with WAS 6.1 (IBM JVM 1.5) so it worked fine, but with our production, it's WAS 6.0 (IBM JVM 1.4). Do you remember this problem? I think you helped us by then.


Soobaek Jang added a comment - 16/Apr/08 03:38 PM
further problem...

Subscribing itself page url, as I mentioned before, threw the error upon adding it. However, by going back to that page again, it's getting recursive error and bring the system down again. So it seems like it's not fixed yet.


Ben Speakmon added a comment - 16/Apr/08 04:37 PM
I'll investigate further. Cheers for helping us track this down.

Soobaek Jang added a comment - 16/Apr/08 08:43 PM
Ben,

Thank you for your support here.
Just an update on UTC time error I mentioned above. I was able to get the right files for ical and fix it again with your new code. So please don't spend/care about that problem for now. Whenever you come up with a fix for this problem, I can apply those ical files again and address UTC time error myself.

Thank you!


wiki-support@cisco.com added a comment - 21/Apr/08 08:35 AM
Hi Ben,

Please let us know whether the current bug have been fixed in this version(calender-plugin-2.1.13). If it has been fixed, Should we install it?

Best Regards,
Wiki-Support(M)
Cisco.


Ben Speakmon added a comment - 21/Apr/08 12:51 PM - edited
I've been having trouble reproducing the reported errors. My procedure is as follows:

1) create a new page
2) place one calendar macro into it, which works correctly.
3) clicking on the "Add a calendar" link on the right side
4) selecting "Subscription" as the type of calendar
5) put one of two things in the URL box:

a) the URL of the page itself (http://machine/confluence/display/SPACE)
b) the URL to subscribe to the calendar generated by the macro (which is the link under "Subscribe" and next to "Download" you see when you click on the calendar's name on the right side)

6) finally pressing the "Add" button.

The patch I created disallows 'b'. I cannot reproduce any crash or hang by doing 'a', as Soobaek apparently can. It seems that Cisco-Wiki is having the same issue 'a', but I cannot reproduce it in their version of Confluence either. The attached fixes are for 'b', but since I can't yet find what is causing 'a', they are unlikely to address that problem.

EDIT: I will see if I can detect and prevent 'a' from happening; even if I can't reproduce it properly, it will still help everyone who is suffering from this problem.


Ben Speakmon added a comment - 21/Apr/08 02:20 PM
I've tested a fix for scenario 'a' as outlined above. This plugin was confirmed to work on Confluence 2.5.2 and should also work fine on 2.5.8.

Ben Speakmon added a comment - 21/Apr/08 02:22 PM
This build of 2.1.13 is for Confluence 2.2.6a. Please test them and let me know if it solves your problem.

Soobaek Jang added a comment - 21/Apr/08 02:25 PM - edited
Ben, thanks for your effort here.
Have you tested with to PAGE URL? not only upto space level? /display/space/Home ?

also you can add it without problem, but when you revisit the page again, the problem starts... not sure if you would need to restart the application or not.


Ben Speakmon added a comment - 21/Apr/08 03:22 PM - edited
I tested it by copying and pasting the URL directly from the browser address bar into the URL text field. The code only checks for exact matches. I'm happy to change it to perform such checks.

If you do what I've described, do you get a javascript error, or does it allow you to add the calendar anyway?

EDIT: Sorry, I misunderstood. The code checks to the page level, not just the space level.


Soobaek Jang added a comment - 21/Apr/08 03:55 PM
Ben,

I am able to finish all those step and it gets me an error on the calendar saying
"Unable to read the calendar: Error at line 1: Expected [BEGIN], read [<!DOCTYPE HTML PUBLIC ]"

However, once I leave that page and come back, the problem starts and never be able to get to that page with the calendar.

As you describe, if you can still check such event and prevent it from happening, I am happy to test it out on my end. Again, it's for version 2.1.13.

Thank you!


Ben Speakmon added a comment - 21/Apr/08 05:18 PM
Soobaek,

My apologies – there was a bug in the 2.1.13 version. I've removed that one from this issue and attached another one. I've verified that it works as advertised on my Confluence 2.2.6a instance. Please try it and let me know.


wiki-support@cisco.com added a comment - 22/Apr/08 09:22 AM
Hi Team,

We are facing an issue when click on 'Subscribe' link of a calendar it goes to the below url and it is showing the error "Page cannot be displayed".

webcal://wiki-dev.cisco.com/confluence/plugins/calendar/ical/dc.action?pageId=25133057&cid=myCalendar&scid=1EZY0MC0K2LECOQV04TLY5DD9XAP1PCE

Please look into the issue and let us know how to proceed.

Thanks & Regards,
Wiki Support(M)
Cisco.


wiki-support@cisco.com added a comment - 23/Apr/08 08:06 AM
Hi Ben,

We have also try to replace the word 'webcal://' to 'http://' in the below url:

webcal://wiki-dev.cisco.com/confluence/plugins/calendar/ical/dc.action?pageId=25133057&cid=myCalendar&scid=1EZY0MC0K2LECOQV04TLY5DD9XAP1PCE

Using 'http://' it is showing an error as display in the Calender Issue doc. Please see the attached file.

This issue need to be fixed asap, any update would be helpful.

Thanks & Regards,
Wiki Support(M)
Cisco.


Ben Speakmon added a comment - 23/Apr/08 11:50 AM
Cisco-Wiki,

Is this problem related to the subscription problem we've been addressing in this issue (did it start appearing only with one of the snapshots I've provided) or is it a new problem you've found? If it's a new problem, you should open another issue for it here. If it's related, can you tell me how you noticed the problem and what you expected to happen? I'm not able to reach that calendar link either.


wiki-support@cisco.com added a comment - 24/Apr/08 11:01 AM
Hi Ben,

As we mentioned in case description, it is the same issue that When we click on 'Subscribe' link of a calendar it give its own URL as a target(see the below targeted url), an infinite loop results which brings down our Confluence wiki. This is our main issue.

webcal://wiki-dev.cisco.com/confluence/plugins/calendar/ical/dc.action?pageId=25133057&cid=myCalendar&scid=1EZY0MC0K2LECOQV04TLY5DD9XAP1PCE

The things we did:

  • First, We replace the 'webcal://' to 'http://'. It does not work, we have alredy mentioned encountered error in our earlier notification.
  • Second, we tried with the attached confluecne-plugin-2.1.13.jar and it showing the error attached in screen shot#1.
  • Then, We tried it on ealier versions 2.6v & 2.5v but we are still facing the same error in all earlier versions of calender-plugins. Please see the screen shot#2.
  • And last we tried with calendar-plugin-2.3v which is a outdated version so it is not able to create Calender on wiki page. see the screen shot#3.

Now we are expecting that this issue should be resolved ASAP or if it is a bug then let us know how to disable the 'Subscribe' link from the calendar.

Please update the case ASAP.

Thanks & Regards,
Wiki-Support(M)
Cisco.


Ben Speakmon added a comment - 24/Apr/08 01:19 PM
Cisco-Wiki,

In order for me to diagnose the error more effectively, can you attach your Confluence log to this issue? I'd like to see what the errors and stack traces are when you try to load the plugin.


wiki-support@cisco.com added a comment - 29/Apr/08 07:41 AM
Hi Team,

As per your request I have attached the logs(Catalina.out_29thApr) of errors. You can find the time of errors in the attached logs itself.

Please let us know if want any information from our side.

We need to fix this issue ASAP. Please help us to achieve the same.

Thanks & Regards,

Wiki-Support Team(M)
Cisco.


Ben Speakmon added a comment - 29/Apr/08 01:02 PM
Thanks for sending that. I'll review it and advise you further.

Ben Speakmon added a comment - 29/Apr/08 01:40 PM
I've attached a fresh build of the plugin under the version 2.6.2-SNAPSHOT which I've also confirmed runs correctly in a standalone Confluence 2.5.8 instance. Please try it and report results. If it fails again, please attach the server log captured during the failure.

Thanks again for your help in resolving this.