Announcement Paxton Developers will be unable to respond to any forum question in till Jan 4th. We would like to wish all our Forum members a Merry Christmas.
signinapp
2021-12-02T16:25:57Z
Working with a client running version April 2020 - 6.03 (v1)

We're coming across an issue on their server which we aren't seeing on our test setup. We create a user then try to assign some access permissions.

Sending the following example value works in testing, but returns an error on their system. Any help would be great thank you.

http://10.211.55.3:8080/api/v1/users/2008/doorpermissionset
{
	"accessLevels": [
		3
	],
	"individualPermissions": []
}


{
  "message": "An error has occurred.",
  "exceptionMessage": "psp_UpdateUserAccessPermissions (Line 282, Number 50000): psp_AddSessionMesssages (Line 605, Number 50000): psp_UpdateCards (Line 255, Number 515): Cannot insert the value NULL into column 'crdu_anti_passback_ind', table '@card_user_data'; column does not allow nulls. INSERT fails.",
  "exceptionType": "System.Data.SqlClient.SqlException",
  "stackTrace": "   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)\r\n   at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader(Boolean isInternal, Boolean forDescribeParameterEncryption)\r\n   at System.Data.SqlClient.SqlCommand.InternalEndExecuteNonQuery(IAsyncResult asyncResult, String endMethod, Boolean isInternal)\r\n   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)\r\n   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)\r\n   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Paxton.Data.SqlClient.Adapters.SqlCommandAdapter.<ExecuteNonQueryAsync>d__8.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Paxton.Data.SqlClient.SqlClient.<InternalExecuteNonQueryAsync>d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Paxton.Data.SqlClient.SqlClient.<ExecuteNonQueryAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Paxton.APIData.Net2.Net2Server.Net2ServerUsersService.<UpdateUserDoorAccessPermissions>d__30.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Paxton.Net2.LocalWebAPI.Controllers.UsersController.<UpdateUserDoorAccessPermissions>d__26.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__1`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"
}
teddyk
2021-12-16T02:16:29Z
I got the same error when I'm trying with the following code (with capital letter):


{
  "AccessLevels": [ 10 ],
  "IndividualPermissions": []
}
teddyk
2021-12-16T02:55:51Z
signinapp
2021-12-16T17:48:13Z
Thanks for the suggested workaround but it doesn't seem to help in my case, maybe there is a subtle difference.

Any help from the Paxton side would be gratefully appreciated.
Alexander
2021-12-17T11:47:52Z
Looking at the error it seems the AntiPassbackUser value for that user is null. Is theire a Net2 software version difference between your test environment and this particular site? A workaround is to go into the UI and save the user record which should put a boolean value in this user table field. When you add users do you set this value?
Paxton Forum Administrator
Paxton Access Website 
signinapp
2021-12-17T13:31:52Z
Originally Posted by: Alexander 

Looking at the error it seems the AntiPassbackUser value for that user is null. Is theire a Net2 software version difference between your test environment and this particular site? A workaround is to go into the UI and save the user record which should put a boolean value in this user table field. When you add users do you set this value?



The API on both servers are reporting the same version.
If the user is saved from the UI this does indeed resolve the problem but doesn't work as a workaround because the project goal is automation.
Alexander
2021-12-17T15:28:51Z
Are you providing a value for the IsAntiPassbackUser property for a user object via the API? It will accept null but setting this to false (or true if necessary if you are incorporating the feature) should fix this.
Paxton Forum Administrator
Paxton Access Website 
signinapp
2021-12-18T23:40:30Z
Hello, thank you for your suggestion, I've now tried sending true or false for this value while creating the user (POST) or while updating the user (PUT) and in both cases the return value for isAntiPassbackUser: null
Because of this the issue still exists.
signinapp
2022-01-05T09:59:22Z
Could Paxton please provide some more help?
signinapp
Users browsing this topic
    Announcement Paxton Developers will be unable to respond to any forum question in till Jan 4th. We would like to wish all our Forum members a Merry Christmas.