Closed Bug 1287332 Opened 8 years ago Closed 7 years ago

MODIFICATION_FAILED error occurred when writing to the calendar

Categories

(Calendar :: Lightning Only, defect)

Lightning 4.7.4
Unspecified
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: js, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached image thunderbird.jpg β€”
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.63 Safari/537.36

Steps to reproduce:

i started thunderbird and after a while i see a popup error message box:
An error has occured <- title
An error occurred when writing to the calendar http://192.168.0.86/owncloud/remote.php/dav/calendars/joachim/default/!
Error code: MODIFICATION_FAILED
Description:




Actual results:

in the error console i see lots of things but i don't understand from where that error message comes.


Expected results:

the error message is kind of alright since that remote server is actually offline and can't be read/written to/from it. 

BUT it should not spawn a blocking dialog box to inform me about it as i can't change this since i don't have internet all the time. once the 'ok' button is clicked, the box will reapaer after seconds to minutes. 

so far i didn't find the place in the TB source or plugin source. i would like to comment out the code which shows the box.

please help me to get rid of it! like this TB is really not fit to be used with the calendar and owncloud.
might be related to this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1029731
also see this info on how to reproduce the issue:

https://lastlog.de/blog/posts/android_calendar_and_CalDav.html#results
# source code

1. hg clone http://hg.mozilla.org/comm-central
2. cd comm-central
3. grep 'An error occurred when writing to the calend' * -R

calendar/locales/en-US/chrome/calendar/calendar.properties:# used for an message like 'An error occurred when writing to the calendar Home!'
calendar/locales/en-US/chrome/calendar/calendar.properties:errorWriting=An error occurred when writing to the calendar %1$S!

# the line of code

calendar/locales/en-US/chrome/calendar/calendar.properties:errorWriting=An error occurred when writing to the calendar %1$S!

so in this file: comm-central/calendar/locales/en-US/chrome/calendar/calendar.properties


...
        // When possible, change the error number into its name, to
        // make it slightly more readable.
        var errCode = "0x"+aErrNo.toString(16);
        const calIErrors = Components.interfaces.calIErrors;
        // Check if it is worth enumerating all the error codes.
        if (aErrNo & calIErrors.ERROR_BASE) {
            for (var err in calIErrors) {
                if (calIErrors[err] == aErrNo) {
                    errCode = err;
                }
            }
        }

        var message;
        switch (aErrNo) {
            case calIErrors.CAL_UTF8_DECODING_FAILED:
                message = props.GetStringFromName("utf8DecodeError");
                break;
            case calIErrors.ICS_MALFORMEDDATA:
                message = props.GetStringFromName("icsMalformedError");
                break;
            case calIErrors.MODIFICATION_FAILED:
                errMsg = calGetString("calendar", "errorWriting", [aCalendar.name]);
             default:
                message = aMessage;
         }


        paramBlock.SetString(0, errMsg);
        paramBlock.SetString(1, errCode);
        paramBlock.SetString(2, message);

        this.storedReadOnly = this.calendar.readOnly;
        var errorCode = calGetString("calendar","errorCode", [errCode]);
        var errorDescription = calGetString("calendar","errorDescription", [message]);
        var summary = errMsg + " " + errorCode + ". " + errorDescription;

        // Log warnings in error console.
        // Report serious errors in both error console and in prompt window.
        if (aErrNo == calIErrors.MODIFICATION_FAILED) {
            Components.utils.reportError(summary);
            this.announceParamBlock(paramBlock);
        } else {
            cal.WARN(summary);
        }
    },
the above errors are from lightning 4.7.1.1 

i've now installed lightning 4.7 (download from the plugins page) and the error is gone. not sure if that downgrade works for me in regards to calendar sync with owncloud.
OS: Unspecified → Linux
seems 4.7 suffers from the same issues as 4.7.1.1
so, this sets the error message:

        paramBlock.SetString(0, errMsg); // sure about this

and this probably triggers the message box:

        this.announceParamBlock(paramBlock); // assumption


let's have a look in announceParamBlock then ...
Component: Untriaged → General
Product: Thunderbird → Calendar
Summary: MODIFICATION_FAILED → MODIFICATION_FAILED error occurred when writing to the calendar
Version: 45 Branch → unspecified
the assumption was correct so far. needs more time tough to check.
so this seems to be the trick:

make
        this.announceParamBlock(paramBlock); // assumption

into
        // this.announceParamBlock(paramBlock);

and no more nag-screen

if someone needs to fix it manually and does not know how, just write an email to me:

  js@lastlog.de
so if there are still developers working on lightning, please contact me: js@lastlog.de
Component: General → Lightning Only
Version: unspecified → Lightning 4.7.4
Does this still occur without your workaround? Commenting out code is of course not a solution, that line will certainly be needed for something.

Instead, please make sure you have the cache enabled. If you are not online, you can switch to offline mode to keep changes local until synchronized.

If you are making changes without a network connection and offline mode is not on, then this seems to be working as expected. I'm therefore closing as WFM, but can re-open after discussion.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
using 52.0 with lightning 5.4, the issue is still there and very annoying. could someone just comment out that line upstream please?
and NO it is not resolved at all!
Status: RESOLVED → VERIFIED
As mentioned, commenting out the line is not the right solution. Can you respond to comment 10? Specifically, do you have offline support enabled for the calendar, and are you in offline mode when your connection is broken/off?
Status: VERIFIED → REOPENED
Ever confirmed: true
Resolution: WORKSFORME → ---
Flags: needinfo?(js)
the owncloud backend does not exist anymore but i'm still using this calendar. how to enable the cache you mentioned?

this are my settings:

https://imgur.com/delete/M76PAePHzMxTrmS

[x] switch this calendar on

[ ] read only
[ ] show reminders
[x] offline support
Flags: needinfo?(js)
You have the cache enabled using "offline support", thanks for checking. So if I understand correctly, the server is not available, but you would still like to use the calendar locally without getting any dialogs?

In this case, please export the calendar to an .ics file, then create a new local calendar, then import the data into the local calendar from the .ics file.

If the server does not exist anymore and Lightning cannot write to it, then the error dialog you are getting is expected behavior.
Flags: needinfo?(js)
thing is, if i start the caldav backend on my server, then the backend is online again and i can sync again. it would also be great if i could change the address of the caldav server in the plugin as i hardcoded it with an IP but the IP changed now.

anyways, thanks for your help.
Flags: needinfo?(js)
Unfortunately I don't think it would be a good idea to fix the bug in the way you are proposing. Lighting is working as expected here, given it is in online mode but the server is not available. I understand that for your specific use case this would be helpful, but for the common case the user will want to know if the server is not reachable.

You can probably create an extension that would monkeypatch the functions so that it works for you.
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → WONTFIX
i do now understand the logic behind this:

- user has to manually change between online/offline mode to avoid error messages
- if the calendar can't be synced in online mode, show an error message (the one i complain about here)

but the way it is implemented ATM is an ancient concept and breaks every usability concept users are used to on desktop and especially on mobiles.

that said, i don't see an error message box coming up when my firefox browser is in 'online mode' and i enter 'google.de' into the URL form. following your logic this should happen since the browser can't reach the remove server.

do you think there is anyone capable of changing this implementation into a more modern one which i actually can use for my daily work without getting nuts or having to patch this software manually each time? how much would that cost, maybe we can run a fund-raiser for that purpose. and most importantly, who would implement it?
Very well, I have filed bug 1361026 that contains a more condensed description of this issue. Without having done a full estimate, I suspect if you put a freelancer on this job it could easily be a few thousand Euros to do it right.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: