Problems attaching files to incident in Beta 3

Apr 24, 2011 at 6:21 AM

This command used to work in Beta 2 but now in Beta 3 it throws the following error:

PS C:\> Set-SCSMIncident -ComputerName $servername -id IR50 -AttachmentPath "D:\MailMessage\TicketExists\2011-04-21_22.51.58_-_The_world_is_on_fire.eml"
Set-SCSMIncident : The object you are trying to add does not match the class specified by the role.
At line:1 char:17
+ Set-SCSMIncident <<<<  -ComputerName $servername -id IR50 -AttachmentPath "D:\MailMessage\TicketExists\2011-04-21_22.51.58_-_The_world_is_on_fire.eml"
    + CategoryInfo          : InvalidOperation: (:) [Set-SCSMIncident], InvalidOperationException
    + FullyQualifiedErrorId : BadSet,SMLets.SCSMIncidentSet

I looked through the release notes but didn't see any breaking change related to this.  Did I just miss something?

Thanks.

Developer
Apr 24, 2011 at 8:01 AM

there's nothing i can see by inspection - could you provide the following?

after this:

Set-SCSMIncident -ComputerName $servername -id IR50 -AttachmentPath "D:\MailMessage\TicketExists\2011-04-21_22.51.58_-_The_world_is_on_fire.eml"

please include the output of the following:

$error[0]|format-list -force
$error[0].exception | format-list -force
$error[0].exception.stacktrace
$error[0].exception.innerexception|format-list -force

That will help me debug, i'll give it a try when I can get online

jim

Apr 25, 2011 at 4:03 AM

OK, I reinstalled Beta 3 and reproduced the error. Here is the output of the commands you requested:

PS C:\> Set-SCSMIncident -ComputerName $servername -id IR50 -AttachmentPath "D:\MailMessage\TicketExists\2011-04-21_22.51.58_-_The_world_is_on_fire.eml"

Set-SCSMIncident : The object you are trying to add does not match the class specified by the role.

At line:1 char:17

+ Set-SCSMIncident <<<< -ComputerName $servername -id IR50 -AttachmentPath "D:\MailMessage\TicketExists\2011-04-21_22.51.58_-_The_world_is_on_fire.eml"

+ CategoryInfo : InvalidOperation: (:) [Set-SCSMIncident], InvalidOperationException

+ FullyQualifiedErrorId : BadSet,SMLets.SCSMIncidentSet

PS C:\> $error[0]|format-list -force

Exception : System.InvalidOperationException: The object you are trying to add does not match the class spe

cified by the role.

at Microsoft.EnterpriseManagement.Common.ObjectProjectionHelper.AddInternal(EnterpriseManage

mentObject objectToAdd, ManagementPackRelationshipEndpoint role, ObjectProjectionHelperStatus s

tatus, ObjectProjectionHelperOperations operation)

at Microsoft.EnterpriseManagement.Common.EnterpriseManagementObjectProjection.Add(Enterprise

ManagementObject objectToAdd, ManagementPackRelationshipEndpoint role)

at SMLets.SMHelpers.UpdateIncident(EnterpriseManagementGroup emg, ManagementPackClass clsInc

ident, EnterpriseManagementObjectProjection emop, String impact, String urgency, String status,

String classification, String source, String supportGroup, String comment, String userComment,

String description, String attachmentPath) in c:\Users\Administrator\Documents\WindowsPowerShe

ll\Sources\Main\Source\SMLets\SMLets\Helper.cs:line 830

at SMLets.SCSMIncidentSet.UpdateNamedIncident(EnterpriseManagementGroup emg, String id) in c

:\Users\Administrator\Documents\WindowsPowerShell\Sources\Main\Source\SMLets\SMLets\Incident.cs

:line 918

at SMLets.SCSMIncidentSet.ProcessRecord() in c:\Users\Administrator\Documents\WindowsPowerSh

ell\Sources\Main\Source\SMLets\SMLets\Incident.cs:line 867

TargetObject :

CategoryInfo : InvalidOperation: (:) [Set-SCSMIncident], InvalidOperationException

FullyQualifiedErrorId : BadSet,SMLets.SCSMIncidentSet

ErrorDetails :

InvocationInfo : System.Management.Automation.InvocationInfo

PipelineIterationInfo : {0, 1}

PSMessageDetails :

PS C:\> $error[0].exception | format-list -force

Message : The object you are trying to add does not match the class specified by the role.

Data : {}

InnerException :

TargetSite : Microsoft.EnterpriseManagement.Common.IComposableProjection AddInternal(Microsoft.EnterpriseManagement

.Common.EnterpriseManagementObject, Microsoft.EnterpriseManagement.Configuration.ManagementPackRelatio

nshipEndpoint, Microsoft.EnterpriseManagement.Common.ObjectProjectionHelperStatus, Microsoft.Enterpris

eManagement.Common.ObjectProjectionHelperOperations)

StackTrace : at Microsoft.EnterpriseManagement.Common.ObjectProjectionHelper.AddInternal(EnterpriseManagementObj

ect objectToAdd, ManagementPackRelationshipEndpoint role, ObjectProjectionHelperStatus status, ObjectP

rojectionHelperOperations operation)

at Microsoft.EnterpriseManagement.Common.EnterpriseManagementObjectProjection.Add(EnterpriseManagem

entObject objectToAdd, ManagementPackRelationshipEndpoint role)

at SMLets.SMHelpers.UpdateIncident(EnterpriseManagementGroup emg, ManagementPackClass clsIncident,

EnterpriseManagementObjectProjection emop, String impact, String urgency, String status, String classi

fication, String source, String supportGroup, String comment, String userComment, String description,

String attachmentPath) in c:\Users\Administrator\Documents\WindowsPowerShell\Sources\Main\Source\SMLet

s\SMLets\Helper.cs:line 830

at SMLets.SCSMIncidentSet.UpdateNamedIncident(EnterpriseManagementGroup emg, String id) in c:\Users

\Administrator\Documents\WindowsPowerShell\Sources\Main\Source\SMLets\SMLets\Incident.cs:line 918

at SMLets.SCSMIncidentSet.ProcessRecord() in c:\Users\Administrator\Documents\WindowsPowerShell\Sou

rces\Main\Source\SMLets\SMLets\Incident.cs:line 867

HelpLink :

Source : Microsoft.EnterpriseManagement.Core

PS C:\> $error[0].exception.stacktrace

at Microsoft.EnterpriseManagement.Common.ObjectProjectionHelper.AddInternal(EnterpriseManagementObject objectToAdd,

ManagementPackRelationshipEndpoint role, ObjectProjectionHelperStatus status, ObjectProjectionHelperOperations operatio

n)

at Microsoft.EnterpriseManagement.Common.EnterpriseManagementObjectProjection.Add(EnterpriseManagementObject objectT

oAdd, ManagementPackRelationshipEndpoint role)

at SMLets.SMHelpers.UpdateIncident(EnterpriseManagementGroup emg, ManagementPackClass clsIncident, EnterpriseManagem

entObjectProjection emop, String impact, String urgency, String status, String classification, String source, String su

pportGroup, String comment, String userComment, String description, String attachmentPath) in c:\Users\Administrator\Do

cuments\WindowsPowerShell\Sources\Main\Source\SMLets\SMLets\Helper.cs:line 830

at SMLets.SCSMIncidentSet.UpdateNamedIncident(EnterpriseManagementGroup emg, String id) in c:\Users\Administrator\Do

cuments\WindowsPowerShell\Sources\Main\Source\SMLets\SMLets\Incident.cs:line 918

at SMLets.SCSMIncidentSet.ProcessRecord() in c:\Users\Administrator\Documents\WindowsPowerShell\Sources\Main\Source\

SMLets\SMLets\Incident.cs:line 867

PS C:\> $error[0].exception.innerexception|format-list -force

PS C:\>

Sorry about the formatting. Anyway, I’m just going to go back to using Beta 2 for now as that works just fine.

Thanks,

-Jeff.

From: jtruher [email removed]
Sent: Sunday, April 24, 2011 1:02 AM
To: ting@tingsys.com
Subject: Re: Problems attaching files to incident in Beta 3 [smlets:255070]

From: jtruher

there's nothing i can see by inspection - could you provide the following?

after this:

Set-SCSMIncident -ComputerName $servername -id IR50 -AttachmentPath "D:\MailMessage\TicketExists\2011-04-21_22.51.58_-_The_world_is_on_fire.eml"

please include the output of the following:

$error[0]|format-list -force
$error[0].exception | format-list -force
$error[0].exception.stacktrace
$error[0].exception.innerexception|format-list -force

That will help me debug, i'll give it a try when I can get online

jim

Developer
Apr 25, 2011 at 5:05 PM

yep - it's a bug.

It happened when the helper functions were refactored. I've got a fix (posted) and I've recreated the msi.

Try downloading the Beta 3 again and reinstall (I didn't change the release number just updated the release)

 

Apr 25, 2011 at 10:46 PM

New version works much better. Thanks!

-Jeff.

From: jtruher [email removed]
Sent: Monday, April 25, 2011 10:06 AM
To: ting@tingsys.com
Subject: Re: Problems attaching files to incident in Beta 3 [smlets:255070]

From: jtruher

yep - it's a bug.

It happened when the helper functions were refactored. I've got a fix (posted) and I've recreated the msi.

Try downloading the Beta 3 again and reinstall (I didn't change the release number just updated the release)