Problem description
A trigger cannot trigger function execution.
Causes
- The rules for triggering function execution are not met.
- The role configured for the trigger is incorrect.
Solutions
Solution 1: Check whether the rules for triggering function execution are met
- OSS triggers
- The Object Storage Service (OSS) bucket and your function must reside in the same region.
- The prefix or suffix of the uploaded object must be the same as the object prefix or suffix that you configured for the trigger.
For example, if you set the object prefix to ab, and upload a/b.zip, ab.zip, and abc.zip to OSS, only ab.zip and abc.zip can trigger function execution.
- The OSS event must be the same as the trigger event. Otherwise, function execution cannot be triggered. The following items describe the cases in which the OSS event does not match the trigger event.
- You upload an object by using ossbrowser and multipart upload. After the upload, the event is
oss:ObjectCreated:CompleteMultipartUpload
. If the trigger event that you configured isoss:ObjectCreated:PutObject
oross:ObjectCreated:PostObject
, the function execution cannot be triggered. - The event that you upload an object by using the console is
oss:ObjectCreated:PostObject
, but the trigger event that you configured isoss:ObjectCreated:PutObject
. The event that you upload a file by calling theoss:ObjectCreated:PutObject
operation isoss:ObjectCreated:PutObject
, but the trigger event that you configured isoss:ObjectCreated:PostObject
. In both cases, the function execution cannot be triggered.
- You upload an object by using ossbrowser and multipart upload. After the upload, the event is
- When you delete an object from a bucket for which versioning is enabled in OSS, you must specify the version ID.
If you do not specify the version ID when you use ossbrowser to delete an object, the
oss:ObjectRemoved:DeleteObject
oross:ObjectRemoved:DeleteObjects
event is not triggered. The current version of the object becomes a previous version, and a delete marker is added. For more information, see FAQ.
- Tablestore triggers
You must enable the Stream feature for the data table of a Tablestore instance. For more information, see Step 1: Enable the Stream feature for the data table.
Solution 2: Check whether the role of the trigger is correct
Check whether the role that you configured for the trigger is deleted, or whether the role has the required permissions. We recommend that you configure standard roles for triggers. For example, you can configure the AliyunOSSEventNotificationRole
role for OSS triggers. For more information, see Configure a native OSS trigger.
Contact us
If you still cannot trigger function execution after you perform the preceding steps, join the DingTalk group 11721331 to communicate instantly with Function Compute engineers. When you contact technical support, provide information such as the ID of your Alibaba Cloud account, the name of your OSS bucket, the name of your service in Function Compute, the name of your function, and the name of your event source.