405 Method not allowed when trying to access Camunda REST API

Hi,

We recently tried to create a POC for Camunda. Everything works fine when the service is run locally, from http://localhost:8080. For example I accessed /engine-rest/process-definition/key/[workflow]/start from Postman.

When I deployed the app in Kubernetes, I am able to access the UI, bot when interacting with the REST API I keep getting this response:

{
    "type": "NotAllowedException",
    "message": "HTTP 405 Method Not Allowed"
}

Checking the logs I am not finding anything more useful:

EVENT=[SERVICE_ERROR] ERROR_MESSAGE=[HTTP 405 Method Not Allowed]
javax.ws.rs.NotAllowedException: HTTP 405 Method Not Allowed

I disabled spring security:

@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.csrf().disable()
                .authorizeRequests()
                .antMatchers("/**").permitAll()
                .anyRequest()
                .authenticated();
    }

    @Override
    public void configure(final WebSecurity web) {
        web.ignoring().antMatchers("/**");
    }
}

I also changed the endpoint URL:

@Component
@ApplicationPath("/resources")
public class RESTConfig extends CamundaJerseyResourceConfig {
}

I am still getting 405 responses when calling the resource deployed in Kubernetes at /resources/process-definition/key/[workflow]/start

Do you have any idea what else I can try? I tried previously both endpoints prefix:

  • engine-rest/resources/process-definition/key/[workflow]/start - 405 Method not allowed
  • rest/resources/process-definition/key/[workflow]/start - 404 Not found

Update: the endpoint started working after I changed the ingress URL to another one and back to that URL again. Still no idea why it was not working in the first instance.

1 Like

Thanks for letting us know you found a solution… even if the cause is still unknown :slight_smile: