1
Vote

Date format not recognized

description

Hello fox !

I have a little issue. I can't have my redmine task in my task list because of this error :
Username: ---; URL: http://f---/redmine/issues.xml?assigned_to_id=56/
System.FormatException: String was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseExactMultiple(String s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
   at System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style)
   at Redmine.RedmineXmlParser.ParseDateTime(String s)
   at Redmine.RedmineXmlParser.ParseIssues(String xml)
   at Redmine.RedmineService.GetIssues(String query)
   at RedmineTaskListPackage.IssueLoader.GetIssues(ConnectionSettings settings)
This is my xml code when I access it with my browser.
<?xml version="1.0" encoding="UTF-8"?>
<issues total_count="1" offset="0" limit="25" type="array">
    <issue>
        <id>1865</id>
        <project id="31" name="Traceability" />
        <tracker id="3" name="Support" />
        <status id="1" name="New" />
        <priority id="2" name="Normal" />
        <author id="56" name="---" />
        <assigned_to id="56" name="---" />
        <subject>Test</subject>
        <description>Test</description>
        <start_date>2015-01-30</start_date>
        <due_date>2015-01-30</due_date>
        <done_ratio>0</done_ratio>
        <is_private>false</is_private>
        <estimated_hours>1.0</estimated_hours>
        <custom_fields type="array">
            <custom_field id="2" name="Requirement Id">
                <value />
            </custom_field>
            <custom_field id="3" name="Root Cause">
                <value>Test</value>
            </custom_field>
            <custom_field id="4" name="Environment">
                <value>DEV</value>
            </custom_field>
            <custom_field id="5" name="Version(s) Impacted" multiple="true">
                <value type="array" />
            </custom_field>
        </custom_fields>
        <created_on>2015-01-30T13:10:16Z</created_on>
        <updated_on>2015-01-30T13:10:16Z</updated_on>
        <closed_on />
    </issue>
</issues>

comments

lmn wrote Feb 1, 2015 at 2:41 PM

Thanks for your effort and the detailed bug report. Do you have any other issues with different date time format? These are completely valid, I couldn't reproduce the exception, see https://dotnetfiddle.net/WIOZVy

Jaisus wrote Feb 2, 2015 at 8:34 AM

Those are the very lonly one with I have issues. I don't no where it is going wrong. May be in the file parsing ? I really do not know.

May be the code try to interpret a field in date time where it is not required. The estimated hours maybe. I don't know.

lmn wrote Feb 2, 2015 at 9:16 PM

I successfully parsed the whole xml you posted, and still no exception was thrown, see https://dotnetfiddle.net/WKjT5s.

It would be great if you could debug it in your environment, or point me in the right direction.

Jaisus wrote Feb 3, 2015 at 7:51 AM

I m going to do it as soon as possible ;)

I have to do some work before but I will do it as soon as I can.

lmn wrote Feb 3, 2015 at 8:33 AM

Great! I'll release the new version at once.

You will need to install Visual Studio SDK, here's the link for 2013:
http://www.microsoft.com/en-us/download/details.aspx?id=40758

Set RedmineTaskListPackage as startup project, on Debug page in the project's properties set Start Action to Start external program:
<Visual studio installation path>\Common7\IDE\devenv.exe
And command line arguments to:
/RootSuffix Exp 
This is for starting an experimental instance of Visual Studio. You will be able to set breakpoints in code, and find the cause of exception.

If you have any difficulties, I'll guide you through.

Jaisus wrote Feb 13, 2015 at 8:01 AM

Sorry to post so late ;)

I cannot do anything about this problem because I have some issues than take me a lot of time. I will install a redmine at my home for some testing (I cannot change the configuration of anything at work for now) and test with the same configuration.

I will debug it as soon as possible ;)

Thanks for your work ;)

Qwib wrote Mar 19, 2015 at 7:26 PM

Are you running this in 2010? I had the same issue.

I added debug code and recompiled the code in 2012 and installed the new dll's on my 2010 dev box. Never saw the errors and it started working.

Not sure how the release code is compiled, but maybe compiling it in 2013, it does not work in 2010. Just guessing, but it does work if you recompile it in 2012 for 2010.

mkaring wrote Aug 6, 2015 at 12:17 PM

I got this issue too. The format specification that is required in my case is "yyyy-MM-dd HH:mm:ss UTC", but this one is not in the current release. Are there any plans for publishing a hotfix?