Results 1 to 6 of 6

Thread: postinig to calendar with curl fails

  1. #1
    SpaceBass is offline Active Member
    Join Date
    Jan 2007
    Posts
    30
    Rep Power
    8

    Default postinig to calendar with curl fails

    Hey folks,
    I'm working on some very very very preliminary integration with Stikkit.
    I'm no programmer but I can hack my way around a shell script...
    Stikkit's API allows me to pull my calendar items in .ics format, which I've done using curl. I was hoping to then use curl again to post those items into zimbra.

    I did some searching for the command and found:
    Code:
     curl -u user--data-binary ~/stikkits.ics http://server/zimbra/home/user/calendar?fmt=ics
    However, it seems to fail on the first line of my stikkits.ics file (posed below)

    I've also tried just using the built in sync feature to point a new calendar to Stikkit's feed (which I believe is an atom by default). Thats not an idea solution, but it was a way to troubleshoot. I didn't get any errors, but I didn't get any appointments either.

    My goal is to eventually write a zimlet that lets me do some 2 way syncing b/t the two, but right now I have to do it with baby steps...

    here is the result of my stikkit API call that returns a .ics file

    Code:
    BEGIN:VCALENDAR
    VERSION:2.0
    METHOD:PUBLISH
    PRODID:-//Values of n//NONSGML Stikkit//EN
    BEGIN:VEVENT
    DTSTART;TZID=America/New_York:20070828T000000
    BEGIN:VALARM
    ACTION:DISPLAY
    TRIGGER:20070827T234500
    DESCRIPTION:Lunar eclipse\n\nOn august 28\nRemind me\nTag as photography
    REPEAT:4
    END:VALARM
    SUMMARY:Lunar eclipse
    DESCRIPTION:Lunar eclipse\n\nOn august 28\nRemind me\nTag as photography
    CATEGORIES:photography
    URL:http://www.stikkit.com/stikkits/318677
    CLASS:PRIVATE
    CREATED:20070306T123639
    LAST-MODIFIED:20070306T123639
    SEQ:1
    UID:http://www.stikkit.com/stikkits/318677
    END:VEVENT
    Like I said, I'm no programmer, but if I need to modify a tag or field I think I can manage that....

    thanks in advance!

  2. #2
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    11

    Default More detail...

    Quote Originally Posted by SpaceBass View Post
    Code:
     curl -u user--data-binary ~/stikkits.ics http://server/zimbra/home/user/calendar?fmt=ics
    Just to make sure, you actually have spaces between the user and the --data-binary, right?

    If so, what error is being returned?
    Bugzilla - Wiki - Downloads - Before posting... Search!

  3. #3
    SpaceBass is offline Active Member
    Join Date
    Jan 2007
    Posts
    30
    Rep Power
    8

    Default

    Good catch, yes I do have spaces there...when I replaced my actual username with the word 'user' I must have lost the space...


    Code:
    <html><head><title>Apache Tomcat/5.5.15 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: parse error: Caught ParseException parsing calendar: net.fortuna.ical4j.data.ParserException: Expected [BEGIN], read [/Users/ndawson/nickstikkits.ics] at line 1
    /Users/ndawson/nickstikkits.ics
            com.zimbra.cs.service.UserServlet.doPost(UserServlet.java:445)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:162)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            com.zimbra.webClient.filters.SetHeaderFilter.doFilter(SetHeaderFilter.java:286)
    </pre></p><p><b>root cause</b> <pre>com.zimbra.common.service.ServiceException: parse error: Caught ParseException parsing calendar: net.fortuna.ical4j.data.ParserException: Expected [BEGIN], read [/Users/ndawson/nickstikkits.ics] at line 1
    /Users/ndawson/nickstikkits.ics
            com.zimbra.common.service.ServiceException.PARSE_ERROR(ServiceException.java:193)
            com.zimbra.cs.mailbox.calendar.ZCalendar$ZCalendarBuilder.build(ZCalendar.java:914)
            com.zimbra.cs.service.formatter.IcsFormatter.saveCallback(IcsFormatter.java:127)
            com.zimbra.cs.service.formatter.Formatter$SaveOperation.callback(Formatter.java:273)
            com.zimbra.cs.operation.Operation.schedule(Operation.java:190)
            com.zimbra.cs.service.formatter.Formatter.save(Formatter.java:103)
            com.zimbra.cs.service.UserServlet.doPost(UserServlet.java:438)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:162)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            com.zimbra.webClient.filters.SetHeaderFilter.doFilter(SetHeaderFilter.java:286)
    </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.15</h3></body></html>

  4. #4
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    11

    Default Bugzilla!

    Looks like a syntax error parsing your .ics file. I'm not an .ics wizard, so why not just file this in bugzilla and attach your .ics file as an attachment to the new bug? We'll let you know if the .ics file is completely malformed or if there's a parser bug on our side...
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #5
    SpaceBass is offline Active Member
    Join Date
    Jan 2007
    Posts
    30
    Rep Power
    8

    Default

    Quote Originally Posted by dkarp View Post
    Looks like a syntax error parsing your .ics file. I'm not an .ics wizard, so why not just file this in bugzilla and attach your .ics file as an attachment to the new bug? We'll let you know if the .ics file is completely malformed or if there's a parser bug on our side...
    I'm happy to do that. I'm no stranger to software development in my profession but I am when it comes to open source and community efforts like this. I wasn't sure if 'just anyone' could log issues in bugzilla and what kinds of things constitute valid issues.

    I'll log it today, thanks.

  6. #6
    schemers is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    228
    Rep Power
    9

    Default

    Note that use you can also use zmprov/zmmailbox to post to a rest url:

    Code:
    zmprov sm user1 pru /calendar test.ics
    The sm (selectMailbox) command in zmprov will select a mailbox and switch you into zmmailbox command mode.

    The pru (postRestUrl) command (part of zmmailbox) will post a file to a particular URL that is relative to the account.

    I posted the sample you provided (after adding a END:VCALENDAR), and the server log (/opt/zimbra/log/mailbox.log) has:

    Code:
    com.zimbra.common.service.ServiceException: invalid request: Could not parse DURATION string: 20070827T234500
    Your sample had that value in TRIGGER:
    Code:
    TRIGGER:20070827T234500
    In taking a quick look at the iCalendar RFC, TRIGGER is supposed to be a duration relative to the appointment start time. If you want it to be a specific time, you need to use a different format:

    Code:
         TRIGGER;VALUE=DATE-TIME:19970317T133000Z
    I'm no iCalendar expert though, I just did a quick search through the RFC (and I'm in the middle of implementing calendar for the basic html client).
    Bugzilla - Wiki - Downloads - Before posting... Search!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. updating shared calendar remotely fails with error
    By crunchywelch in forum Administrators
    Replies: 0
    Last Post: 06-04-2007, 08:37 PM
  2. Outlook/Zimbra Private Appointments Issue
    By Smurthey in forum Zimbra Connector for Outlook
    Replies: 0
    Last Post: 03-09-2007, 07:29 AM
  3. Calendar Use Case
    By enthenergy in forum Administrators
    Replies: 2
    Last Post: 12-01-2006, 06:16 PM
  4. Outlook connector sync fails for shared calendar -- release 4.03GA
    By nyamada in forum Zimbra Connector for Outlook
    Replies: 13
    Last Post: 11-21-2006, 02:16 PM
  5. M2 Experiences?
    By jordandeamattson in forum Users
    Replies: 17
    Last Post: 11-22-2005, 03:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •