<p>I am using argo events/sensors to create a Kubernetes Job , the sensor gets triggered correctly but it is giving me error &quot;the server could not find the requested resource&quot;</p>
<p>Here is my sensor.yaml</p>
<pre><code>apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
  name: exp-webhook
spec:
  template:
    serviceAccountName: crypto-job-sa
  dependencies:
    - name: payload
      eventSourceName: webhook
      eventName: devops-toolkit
  triggers:
    - template:
        name: sample-job
        k8s:
          group: batch
          version: v1
          resource: Job
          operation: create
          source:
            resource:
              apiVersion: batch/v1
              kind: Job
              metadata:
                name: exp-job-crypto
#                annotations:
#                  argocd.argoproj.io/hook: PreSync
#                  argocd.argoproj.io/hook-delete-policy: HookSucceeded
              spec:
                ttlSecondsAfterFinished: 100
                template:
                  spec:
                    restartPolicy: OnFailure
                    containers:
                      - name: crypto-job
                        image: docker.artifactory.xyz.com/xyz/pqr:master-b1b347a
</code></pre>
<p>And here is the error details.</p>
<pre><code>   {&quot;level&quot;:&quot;error&quot;,&quot;ts&quot;:1624900390.6760905,&quot;logger&quot;:&quot;argo-events.sensor&quot;,&quot;caller&quot;:&quot;sensors/listener.go:271&quot;,&quot;msg&quot;:&quot;failed to execute a trigger&quot;,&quot;sensorName&quot;:&quot;exp-webhook&quot;,&quot;error&quot;:&quot;failed to execute trigger: timed out waiting for the condition: the server could not find the requested resource&quot;,
            &quot;errorVerbose&quot;:&quot;timed out waiting for the condition: the server could not find the requested resource\nfailed to execute trigger\ngithub.com/argoproj/argo-events/sensors.
    (*SensorContext).triggerOne\n\t/home/jenkins/agent/workspace/argo-events_master/sensors/listener.go:328\ngithub.com/argoproj/argo-events/sensors.(*SensorContext).triggerActions\n\t/home/jenkins/agent/workspace/argo-events_master/sensors/listener.go:269\ngithub.com/argoproj/argo-events/sensors.(*SensorContext).listenEvents.func1.3\n\t/home/jenkins/agent/workspace/argo-events_master/sensors/listener.go:181\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357&quot;,&quot;triggerName&quot;:&quot;sample-job&quot;,&quot;triggeredBy&quot;:[&quot;payload&quot;],&quot;triggeredByEvents&quot;:[&quot;32396264373063382d306336312d343039322d616536652d623965383531346666373234&quot;],&quot;stacktrace&quot;:&quot;github.com/argoproj/argo-events/sensors.
        
    (*SensorContext).triggerActions\n\t/home/jenkins/agent/workspace/argo-events_master/sensors/listener.go:271\ngithub.com/argoproj/argo-events/sensors.(*SensorContext).listenEvents.func1.3\n\t/home/jenkins/agent/workspace/argo-events_master/sensors/listener.go:181&quot;}
</code></pre>
<p>But it does not tell what resource is not found. Can someone please help? I don't know what is the mistake here.</p>

<p>So the error was , instead of</p>
<pre><code>resource: Job
</code></pre>
<p>it should be</p>
<pre><code>resource: jobs
</code></pre>
<p>That fixed this issue.</p>
