lithnet / googleapps-managementagent

Google Workspace Management Agent for MIM 2016
MIT License
12 stars 4 forks source link

Object of type 'System.Int64' cannot be converted to type 'System.Nullable`1[System.Int32]'. #4

Closed khandelwalpiyush closed 8 years ago

khandelwalpiyush commented 8 years ago

Error on exporting to Google.. suspect is the maxMessageBytes attribute which is of type integer and trying to put the value "26214400"

****************************************
An exception has occurred in <PutExportEntries>b__0
Type: System.ArgumentException
Message: Object of type 'System.Int64' cannot be converted to type 'System.Nullable`1[System.Int32]'.
Source: mscorlib
TargetSite: System.Object TryChangeType(System.Object, System.Reflection.Binder, System.Globalization.CultureInfo, Boolean)
StackTrace:
   at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
   at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
   at Lithnet.GoogleApps.MA.AdapterPropertyValue.UpdateField(CSEntryChange csentry, Object obj) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\AttributeAdapters\AdapterPropertyValue.cs:line 83
   at Lithnet.GoogleApps.MA.ApiInterfaceGroupSettings.ApplyChanges(CSEntryChange csentry, SchemaType type, Object& target, Boolean patch) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ApiInterfaces\ApiInterfaceGroupSettings.cs:line 34
   at Lithnet.GoogleApps.MA.ApiInterfaceGroup.ApplyChanges(CSEntryChange csentry, SchemaType type, Object& target, Boolean patch) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ApiInterfaces\ApiInterfaceGroup.cs:line 115
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChangeAdd(CSEntryChange csentry, CSEntryChange deltaCSEntry, MASchemaType maType, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 107
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChangeObject(CSEntryChange csentry, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 64
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChange(CSEntryChange csentry, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 21
   at Lithnet.GoogleApps.MA.ManagementAgent.<>c__DisplayClass38_0.<PutExportEntries>b__0(CSEntryChange csentry) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 149
****************************************
ryannewington commented 8 years ago

@khandelwalpiyush I've added a potential fix for this in 1.1.6089. Can you validate and let me know if it resolves the issue?

khandelwalpiyush commented 8 years ago

@ryannewington that error is no more but there is a new one "Specified cast is not valid."

Will check and raise a new ticket. Not sure if related

Group got created and also domains are now accessible

ryannewington commented 8 years ago

Changes did not work as expected

ECMA2 MA export run caused an error. 

Error Name: Specified cast is not valid. 
 Error Detail: at Lithnet.GoogleApps.MA.SchemaBuilder.<>c.b__13_2(Object value) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\Schema\SchemaBuilder.cs:line 1307
 at Lithnet.GoogleApps.MA.AdapterPropertyValue.UpdateField(CSEntryChange csentry, Object obj) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\AttributeAdapters\AdapterPropertyValue.cs:line 80
 at Lithnet.GoogleApps.MA.ApiInterfaceGroupSettings.ApplyChanges(CSEntryChange csentry, SchemaType type, Object& target, Boolean patch) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ApiInterfaces\ApiInterfaceGroupSettings.cs:line 30
 at Lithnet.GoogleApps.MA.ApiInterfaceGroup.ApplyChanges(CSEntryChange csentry, SchemaType type, Object& target, Boolean patch) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ApiInterfaces\ApiInterfaceGroup.cs:line 117
 at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChangeAdd(CSEntryChange csentry, CSEntryChange deltaCSEntry, MASchemaType maType, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 102
 at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChangeObject(CSEntryChange csentry, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 59
 at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChange(CSEntryChange csentry, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 16
 at Lithnet.GoogleApps.MA.ManagementAgent.<>c__DisplayClass33_0.b__0(CSEntryChange csentry) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 136
khandelwalpiyush commented 8 years ago

Export add has worked on latest build