role_violation when restoring namespace containing UDFs
When restoring a backup from a namespace containing UDFs (User Defined Functions) the following error is thrown:
2016-03-29 06:04:36 GMT [INF]  Opened backup file nsNamespaceUDF/BB9D1A59E05BE24_00016.asb 2016-03-29 06:04:36 GMT [INF]  Restoring 1 UDF file(s) 2016-03-29 06:04:36 GMT [ERR]  Error while putting UDF file MyUDF.lua - code 100: error=role_violation at src/main/aerospike/as_info.c:214 2016-03-29 06:04:36 GMT [ERR]  Error while restoring UDFs to cluster
This error indicates that there is a permission missing for the user being used to restore the backup file. To register UDFs the restore user needs the data-admin role. The restore process is, in effect, registering the UDF in the target cluster.
Grant the data-admin role to the user restoring the backup, retry the restore process.
- The same permissions structure applies to secondary indices and so data-admin is also required if the source namespace (and therefore backup file) contains secondary indices
- The restore process can be started with – no udfs (or –no indexes) if UDFs (or indices) are not required in the target http://www.aerospike.com/docs/tools/backup/asrestore.html
- The sys-admin role inherits all permissions of data-admin as it is a superuser so it would be able to overcome this error. Care should be taken when granting the sys-admin role as this includes wide ranging permissions.
- It is important to note that different permissions are required for backup and restore of namespaces containing UDFs. This topic is covered fully here: