Aspose.Tasks 2.4.0.0 ProjectReader.Read() Error

Hi,


Yes, I understand. This is the main problem with projects that the information is mostly closed.

I think in your case we can have too different problems. One with key and second with casting. Unfortunately, parsing MPP is not so straight as it is with XML.

I am going to discuss with our team leader a possibility to add a tracing mode in our product to find the issue source.Also I am trying to repeat the problem on my side but still unsuccessful.

Sorry for inconvenience.

Hi Sergey,

IMHO... Time spent providing improved error handling will allow us to help find the problems and build cases for your test system ... I'd like to shift my time from guessing to poinpointing the problems.

I'll turn around results asap for any interim versions you make!!

Regards, Bruce

Hi,


I have made an interim Aspose.Tasks 2.8.0.5 build and attached it to this forum thread.

Could you please try it with your problem files and send us exception log information?

Sorry for inconvenience.

Wow that was a quick turn around time!!

Sorry I was being a little short in the last couple posts, but I have been getting a lot of pressure from my management about why we I told them to buy this when it hasn't been working for us. So I have been kind of the bad guy for a little while.

Here is the output from one of the files. Not sure how helpful it is but it looks like it is coming from a task in the mpp file

Message:
Project reading exception.

Log:
Reading project data in 'MPP9' format, created by 'MSP2003' started.
Reading project's calendars information started.
Calendar with UID='10' was read successfully.
Calendar with UID='9' was read successfully.
Calendar with UID='8' was read successfully.
Calendar with UID='7' was read successfully.
Calendar with UID='6' was read successfully.
Calendar with UID='5' was read successfully.
Calendar with UID='4' was read successfully.
Calendar with UID='3' was read successfully.
Calendar with UID='2' was read successfully.
Calendar with UID='1' was read successfully.
Reading calendars finished.
Reading extended attributes definitions started.
Reading extended attributes definitions finished.
Reading project's outline codes started.
Reading project's outline codes finished.
Reading common project data started.
Reading common project data finished.
Reading project's tasks started.

Inner exception message:
Index was outside the bounds of the array.

Here is some output from a different file

Message:
Project reading exception.

Log:
Reading project data in 'MPP9' format, created by 'MSP2003' started.
Reading project's calendars information started.
Calendar with UID='17' was read successfully.
Calendar with UID='16' was read successfully.
Calendar with UID='15' was read successfully.
Calendar with UID='6' was read successfully.
Calendar with UID='5' was read successfully.
Calendar with UID='4' was read successfully.
Calendar with UID='3' was read successfully.
Calendar with UID='2' was read successfully.
Calendar with UID='1' was read successfully.
Reading calendars finished.
Reading extended attributes definitions started.
Reading extended attributes definitions finished.
Reading project's outline codes started.
Reading project's outline codes finished.
Reading common project data started.
Reading common project data finished.
Reading project's tasks started.
Task with UID='10102' was read successfully.
... Many more items ...
Task with UID='17316' was read successfully.

Inner exception message:
Object reference not set to an instance of an object.

Please let me know what additional information I can provide you that will help resolve these issues

Hi,

Impressive information ... I was surprised at how much information was provided in the log.

In the error information I saw, the 'stack trace' information pointed to the exact step that caused the problem. Did you pass any of this information onto Sergey?

The other area that I've had some very weird behaviour relates to Locale specific information. For example, in vb the difference between 'str' and 'cstr' can be significant.

Regards, Bruce

Hi,


Thank you a lot for the information. Now I can understand how large your projects are…

For the first file I will try to analyze the issue on my side first.

For the second file. Could you open the project in MS Project 2003 (the version is important!!!), save it in a some new place, delete all resources, search for the task with UID = 17316 (you can add the column to the view), delete all tasks except this one and 5 tasks above and 5 task down from it, delete the rest tasks names and save it again?
Check the resulting file for the error. In case if you still have the error with the cut file - send it me by e-mail. I think that the file size will be considerably less. You can check for any important information like extended attributes, Notes etc. Delete them too to prevent any information leak. And you can modify the truncated project data by some way as well but not too much to keep the error.

Sorry for inconvenience again and thank you for your cooperation.

Ok I did what you suggested.

  • Opened the file in 2003 SP3
  • This file didn't have any resources
  • Deleted all the tasks excepted the required ones
    • I counted 5 tasks after UID 17316 and deleted all the ones below
    • I deleted all the ones above expect for the required summary tasks

Then I tried opening the file using Aspose.Tasks and no errors occurred?! So not sure what out path forward is going to be here.

Hi,


Thank you a lot for your cooperation.

Could you please repeat it but keep undeleted 5 tasks above the task with UID = 17316 too? You can shift them to outline level 1 if you need as it is not important here.

I am going to update the log information in this month release and add more detailed information about tasks parsing process. Sorry for inconvenience and thank you for your time. We really need the data.

I kept all the tasks that were at the same level, which were 19 of them. I deleted everything else. The UID = 17316 was closer to the end of that list, so there were more than 5 prior to it in the sample. Since your product was able to open it now I decided to save the xml and noticed something strange in the note field. Not sure if this is the source of the problem

Sample from MSProject
Trace ID U20B-Apr09 from PCD incorporates PGPS Development GJL

Sample from the generated Xml
屻瑲ㅦ慜獮屩湡楳灣ㅧ㔲尲敤晦尰敤汦湡ㅧ㌰笳晜湯瑴汢屻て晜睳獩屳灦煲尲捦慨獲瑥‰牁慩㭬絽਍屻尪敧敮慲潴⁲楒档摥〲㔠㔮⸰㤹㈮㘰㬱屽楶睥楫摮尴捵就慰摲晜尰獦㘱吠慲散䤠⁄㉕䈰䄭牰㤰映潲䍐⁄湩潣灲牯瑡獥倠假⁓敄敶潬浰湥⁴䩇⹌†灜牡਍ൽ

Another interesting thing I noticed is that the file size is still really large considering how much information it appears to contain

Another note that might help you guys is that our files are password protected. Not sure if that could contribute to the problem. Didn't seem to be a problem when I trimmed the file down

Hi,


We are going to add additional logging information in our next release (next week).

The Notes are in encoded RTF format. We have used here undocumented MS Project feature to read RTF data in this form from XML. Now we are going to remove it and replace by plain text. You can find some issue discussion in this thread.

Hi,


Could you please try to read the problem files with new Aspose.Tasks 2.9.0 and provide us with the log information?

Thank you for cooperation.

Ok I was able to track the problem down to the specific task uid 8761. I then deleted all the unnecessary tasks while preserving the current structure and saved the file. I then attempted to have Aspose.Tasks parse the file in both .mpp and .xml formats unsuccessfully. Here is the output from both formats


Xml

Message:
Project reading exception. Current XML element: 'Project\Tasks\Task[3]\Type'.

Log:
Reading project data in 'XML' format, created by 'Undefined' started.
Loading XML data started.
Loading XML data finished.
Reading project's calendars information started.
Reading calendars finished.
Reading common project data started.
Reading common project data finished.
Reading project's outline codes started.
Reading project's outline codes finished.
Reading task extended attribute definitions started.
Reading task extended attribute definitions finished.
Reading project's tasks started.

Inner Exception Message:
Object reference not set to an instance of an object.


MPP

Message:
Project reading exception.

Log:
Reading project data in 'MPP9' format, created by 'MSP2003' started.
Reading project's calendars information started.
Calendar with UID='17' was read successfully.
Calendar with UID='16' was read successfully.
Calendar with UID='15' was read successfully.
Calendar with UID='6' was read successfully.
Calendar with UID='5' was read successfully.
Calendar with UID='4' was read successfully.
Calendar with UID='3' was read successfully.
Calendar with UID='2' was read successfully.
Calendar with UID='1' was read successfully.
Reading calendars finished.
Reading extended attributes definitions started.
Reading extended attributes definitions finished.
Reading project's outline codes started.
Reading project's outline codes finished.
Reading common project data started.
Reading common project data finished.
Reading project's tasks started.
Reading tasks variable data started.
Reading tasks variable data finished.
Reading tasks fixed data started.
Reading tasks fixed data finished.
Reading task with UID='17569' started.
Task with UID='17569' was read successfully.
Reading task with UID='8761' started.

Inner Exception Message:
Object reference not set to an instance of an object.

I really hope this helps isolate the problems that my files are creating

Hi,


Thank you a lot for the data! It looks we have got the key now.

I think the file was damaged and some data is incorrect in the task. MS Project can not read some data from the MPP like task’s type and the value in the XML is really strange as only 0, 1, 2, 3 values are valid according to the schema.

See screen shot attached with the errors.

But as MS Project is capable to read the files we think that Aspose.Tasks must too. We are going to update our code so we can read the rest of data from the file like MS Project does. So I have created a new issue ‘Read data from damaged MPP files.’ with ID = 17229 and linked it to this thread. I am going to create a hot fix ASAP.

Hi,


See the interim build attached. We can read the MPP file on our side with the version (2.9.0.1), so could you check it on your side?

The values in incorrect format which we can not read as they are in the file are assigned to Undefined values, e.g. the task’s type is TaskType.Undefined. Others we read as they are in the file, e.g. the task’s priority is 6636 (it must be between 0 and 1000).

We don’t change XML processing because MS Project can not read the XML file too. There is a list of errors. So despite of the fact that you can read the MPP by MS Project and Aspose.Tasks 2.9.0.1 (I hope) and it is possible to export it to XML, MS Project can not read the XML back because of the errors in the task data. To read the XML created by Aspose.Tasks by MS Project you can just correct the task’s priority by hand or in code as we are ignoring undefined values when export data to XML.

Thank you a lot for your cooperation. We are waiting for your feedback.

Ok I have some good news!! I can read that file without any errors, but I still am getting errors from other files


I am getting this information with the attached file

Message:
Project reading exception.

Log:
Reading project data in 'MPP9' format, created by 'MSP2003' started.
Reading project's calendars information started.
Calendar with UID='10' was read successfully.
Calendar with UID='9' was read successfully.
Calendar with UID='8' was read successfully.
Calendar with UID='7' was read successfully.
Calendar with UID='6' was read successfully.
Calendar with UID='5' was read successfully.
Calendar with UID='4' was read successfully.
Calendar with UID='3' was read successfully.
Calendar with UID='2' was read successfully.
Calendar with UID='1' was read successfully.
Reading calendars finished.
Reading extended attributes definitions started.
Reading extended attributes definitions finished.
Reading project's outline codes started.
Reading project's outline codes finished.
Reading common project data started.
Reading common project data finished.
Reading project's tasks started.
Reading tasks variable data started.
Reading tasks variable data finished.
Reading tasks fixed data started.
Reading tasks fixed data finished.
Reading task with UID='4860' started.

Inner Exception Message:
Index was outside the bounds of the array.


There is another file giving me this information. I cannot provide any more information that this since I cannot remove any propietary information

Message:
Project reading exception.

Log:
Reading project data in 'MPP9' format, created by 'MSP2003' started.
Reading project's calendars information started.
Calendar with UID='6' was read successfully.
Calendar with UID='5' was read successfully.
Calendar with UID='4' was read successfully.
Calendar with UID='3' was read successfully.
Calendar with UID='2' was read successfully.
Calendar with UID='1' was read successfully.
Reading calendars finished.
Reading extended attributes definitions started.
Reading extended attributes definitions finished.
Reading project's outline codes started.

Inner Exception Message:
Item has already been added. Key in dictionary: '302' Key being added: '302'


Here is information from another file

Message:
Project reading exception.

Log:
Reading project data in 'MPP9' format, created by 'MSP2003' started.
Reading project's calendars information started.
Calendar with UID='146' was read successfully.
... A Ton Of Calendars!!
Calendar with UID='1' was read successfully.
Reading calendars finished.
Reading extended attributes definitions started.
Reading extended attributes definitions finished.
Reading project's outline codes started.

Inner Exception Message:
Item has already been added. Key in dictionary: '411' Key being added: '411'


Lastly, from another file

Message:
Project reading exception.

Log:
Reading project data in 'MPP9' format, created by 'MSP2003' started.
Reading project's calendars information started.
Calendar with UID='31' was read successfully.
Calendar with UID='30' was read successfully.
Calendar with UID='8' was read successfully.
Calendar with UID='7' was read successfully.
Calendar with UID='4' was read successfully.
Calendar with UID='3' was read successfully.
Calendar with UID='2' was read successfully.
Calendar with UID='1' was read successfully.
Reading calendars finished.
Reading extended attributes definitions started.
Reading extended attributes definitions finished.
Reading project's outline codes started.

Inner Exception Message:
Item has already been added. Key in dictionary: '701' Key being added: '701'


It feels like we are getting close. Please help me get to the bottom of these last couple problems. I hope most of them are the same fix from the outline codes section of the file. Let me know if you need any more information from me

Hi,


Thank you a lot for the data and good news. It looks we have a problem with the task’s Notes here and again I can not read the XML by MS Project (and Aspose.Tasks). ‘File is damaged’ error was shown.

I need a couple of days to investigate the issue and create a new hot fix then we can switch to Outline codes reading error. I think it is our original ‘Key 303’ error.

Sorry for inconvenience.

Hi,


Quick update: see the interim 2.9.0.2 version attached. Please, check it on your side with the MPP file.

For XML again, as MS Project can not read it we can not too. But you can read MPP by this version of Aspose.Tasks (I hope) and export it to XML and MS Project can open resulting XML file. MS Project 2003 can read the data including tasks notes and the notes formatting is preserved (“encoded rtf feature”).

For second problem, could you try to delete all tasks may be except a couple of upper level, save the file and try to read it by Aspose.Tasks? We have problem in some project level information so I hope we will not lost it in this case.

Waiting for your feedback.

Hi,

I'm pleased to see that the error logging is helping to identify and resolve the problems!! Great job Sergey!!.

As I cannot see all of the items submitted, I'm wondering if you have tried to use MS Project 2003 to save the MPP as an XML file and then create the MS Project XML file using Aspose.tasks and then compare the two XML files. I would expect that the MS Project XML created by MS Project 2003 would be readable by MS Project. Any differences might help point to some areas to investigate.

Apologies if you are already doing this..!

Regards, Bruce

Hi Bruce,


It was a great customers’ request to provide the exception log:).

The XML are indeed created by MS Project 2003 and MS Project 2003 can not read them back…

In some cases MS Project can read damaged MPP but when you convert it to XML you can not read it back. Like in cases above, e.g. XML contains task with priority 6636 or type 6000 or invalid duration format and so on. For first MPP you can see the problem by yourself, see screen shot attached to the post, for second we have some stub of unused data so I had to skip it while reading the file. Now we have to resolve the problem with outline codes…

Sergey,

Ok the notes error seems to be resolved now. Thanks as always for the really quick turn around time. Do you have any idea when the original 'Key 303' error might be resolved?