Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s nginx ingress 2.4.0 2.4.1 422 Errors #1344

Open
LargoUsagi opened this issue Apr 25, 2019 · 1 comment
Open

k8s nginx ingress 2.4.0 2.4.1 422 Errors #1344

LargoUsagi opened this issue Apr 25, 2019 · 1 comment

Comments

@LargoUsagi
Copy link

When deploying a restlet application inside of a docker container to a k8s cluster behind the nginx l7 ingress controller HTTP POST actions return a 422 error.

If you expose a port on the host in the cluster and connect without using the nginx ingress controller POST actions work.

This issue is not present in 2.3.12 and rolling back is how I am mitigating the issue.

Here are the restlet dependencies used in my pom

        <dependency>
            <groupId>org.restlet.jse</groupId>
            <artifactId>org.restlet</artifactId>
            <version>${restlet-version}</version>
        </dependency>
        <dependency>
            <groupId>org.restlet.jse</groupId>
            <artifactId>org.restlet.ext.jackson</artifactId>
            <version>${restlet-version}</version>
        </dependency>
        <dependency>
            <groupId>org.restlet.jse</groupId>
            <artifactId>org.restlet.ext.jetty</artifactId>
            <version>${restlet-version}</version>
        </dependency>
        <dependency>
            <groupId>org.restlet.jse</groupId>
            <artifactId>org.restlet.ext.slf4j</artifactId>
            <version>${restlet-version}</version>
        </dependency>

Here is an example of a failing resource.

ApiResource is a public abstract class ApiResource extends ServerResource class that has protected helper functions.

public class RegisterResource extends ApiResource {


    private final ApplicationUserRegistrationService userRegistrationService;

    @Inject
    public RegisterResource(ApplicationUserRegistrationService userRegistrationService) {
        this.userRegistrationService = userRegistrationService;
    }

    @Post("json")
    public boolean register(RegistrationCredentialsDto creds) {
        var user = userRegistrationService.attemptRegisterNewUser(creds);
        if(user != null) {
            this.setStatus(Status.SUCCESS_CREATED);
            return true;
        }
        this.setStatus(Status.CLIENT_ERROR_CONFLICT);
        return false;
    }

}
@cyberquarks

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants