AR-k12code / CognosDownloader

MIT License
2 stars 3 forks source link

Error Detected in Download File #35

Closed jsulliweb closed 2 years ago

jsulliweb commented 2 years ago

I'm getting an error with the CognosDownloader when I try to run certain reports (Error Detected in Download File), but it seems random, not always the same reports, sometimes running them one at a time will work, other times, even that doesn't work. No real info given on the error, a previous version of the CognosDownloader works and doesn't give the error.

Example of the code I'm using to call the Download script: ."$PSScriptPath\CognosDownload.ps1" -Report ELLevation-Demographics-Rpt -cognosfolder "Ellevation"

carbm1 commented 2 years ago

The "Error detected in download file." Means that we actually got an ERROR ticket returned from Cognos. There should be some sort of information printed out immediately after that.

Are you trying to run this asynchronously? If so, are you running the same report for multiple buildings at the same time with different prompts?

jsulliweb commented 2 years ago

Not at the same time. I download each report and check that it downloaded correctly before going to the next one, but I got this error even just downloading a single file. This is the output that I'm seeing. If it's saying something else, It's clearing it off the screen without me seeing it:

Authenticating and switching to searcysms... Success. Attempting to retrieve report details for Data-HPGuardians-Rpt... Success. Retrieving possible formats... Success.

I didn't include the username in the file path, but everything else is exactly what I'm seeing. Nothing comes up after the error message, just the prompt for the next command.

Edit to add: Looking at the downloaded files, they seem complete. It's just CSV's that haven't been renamed. I see in your code where there should be an error message shown after the Error detected message, but nothing is coming up. When I manually run the "$fileContents = [XML](Get-Content $reportIDHashFilePath)" line against one of the downloaded files and look at $fileContents.error... It's showing that its a null value. That should lead to the else statement to "move" the file, but it's going for the true condition instead. Assuming I'm reading the right section and seeing what you're doing correctly... Which, eh, I think I get the flow of it, but I'm not sure.

carbm1 commented 2 years ago

That is strange. That response should only be seen if there is a ticket from Cognos with an error in it.

Can you please check in the download folder for randomly named files that look like a GUID or HASH? Timestamp should match the same time it errored. Open it in notepad and paste it here?

Thanks,

Craig

On Thu, Dec 2, 2021 at 1:31 PM jsulliweb @.***> wrote:

Not at the same time. I download each report and check that it downloaded correctly before going to the next one, but I got this error even just downloading a single file. This is the output that I'm seeing. If it's saying something else, It's clearing it off the screen without me seeing it:

Authenticating and switching to searcysms... Success. Attempting to retrieve report details for Data-HPGuardians-Rpt... Success. Retrieving possible formats... Success.

  • Data-HPGuardians-Rpt (i1270D2BA97304E1CA28A6CF69DCFDA57) can be exported in the following formats: CSV,PDF,spreadsheetML,XLWA,xlsxData,XML,MHT Downloading Report to "C:\Users*username *\CognosReports\Data-HPGuardians-Rpt.csv"... Error detected in downloaded file.

I didn't include the username in the file path, but everything else is exactly what I'm seeing. Nothing comes up after the error message, just the prompt for the next command.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AR-k12code/CognosDownloader/issues/35#issuecomment-984937562, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFLBJK6YDYGYDIUYU7X77LUO7CSVANCNFSM5JHRPFHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jsulliweb commented 2 years ago

Here's the contents of one of the files:

School_id,School_name 46,Sidney Deener Elementary 47,McRae Elementary School 51,Ahlf Jr. High School 52,Searcy High School 53,Westside Elementary School 54,Southwest Middle School

jsulliweb commented 2 years ago

I added this as an edit above, but just to make sure you see it:

Looking at the downloaded files, they seem complete. It's just CSV's that haven't been renamed. I see in your code where there should be an error message shown after the Error detected message, but nothing is coming up. When I manually run the "$fileContents = [XML](Get-Content $reportIDHashFilePath)" line against one of the downloaded files and look at $fileContents.error... It's showing that its a null value. That should lead to the else statement to "move" the file, but it's going for the true condition instead. Assuming I'm reading the right section and seeing what you're doing correctly... Which, eh, I think I get the flow of it, but I'm not sure.

carbm1 commented 2 years ago

This issue has been resolved. It was an issue with the way the CognosDownloader.ps1 was being launched.