Why is this transaction failing?

I want to use transaction API in Server Code, but I am not getting off the ground. I have watched the tutorials on YouTube, but I am not even getting that far, for some reason. What stupid thing am I doing wrong?

I have removed everything from the transaction basically, only thing I have left is the simple Find operation for a User record now:

But when invoked, all I ever get is still:

16:55:20.577 | SERVER_CODE | INFO | [35473] Building ServerCode Model for path (/opt/backendless/repo/4919877f-4544-2d4b-ff37-cd72374f8e00/files/servercode/CODELESS/toolsAdmin/PRODUCTION)
16:55:20.579 | SERVER_CODE | INFO | [35473] ServerCode Model built in 7ms
16:55:20.584 | SERVER_CODE | INFO | [35473] [B1EDC438-0281-397C-FF90-46BECDE65600] [INVOKE SERVICE] services.toolsAdmin.logTransaction
16:55:20.588 | toolsAdmin | DEBUG | Updating User_Transaction table...
16:55:20.598 | toolsAdmin | DEBUG | Getting User Object for User Id: D3E328BF-(redacted)
16:55:20.643 | toolsAdmin | ERROR | Operation failed! TypeError: Cannot read property 'request' of undefined
16:55:20.643 | SERVER_CODE | INFO | [35473] Processing finished in 199.452ms

What am I doing wrong? Why do I get these TypeErrors?

Hello @Egil_Helland,

We investigated this issue. It seems like context blocks cannot be used inside the AddOperations block. I’ve created an internal ticket for fix. As a workaround for now I can recommend you to create and use a separate variable:

Regards,
Olha

1 Like

Hello @Egil_Helland

We’ve just updated cloud servers with a fix for the issue you described above. Could you kindly let us know whether fix works for you well?

Regards,
Inna