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

MethodView + Serverless Enterprise = GET only? #130

Open
revmischa opened this issue Mar 26, 2020 · 3 comments · Fixed by serverless/dashboard-plugin#444
Open

MethodView + Serverless Enterprise = GET only? #130

revmischa opened this issue Mar 26, 2020 · 3 comments · Fixed by serverless/dashboard-plugin#444

Comments

@revmischa
Copy link
Contributor

With sls enterprise enabled

@blp.route("")
class ThingsView(MethodView):
    @blp.arguments(ProvisionThingSchema, as_kwargs=True)
    @blp.response(ProvisionedThingSchema())
    def post(self, name: str):
        ....

@blp.route("/<string:thing_name>")
class ThingView(MethodView):
    @blp.arguments(SiteConfiguration)
    @blp.response()
    def patch(self, args: dict, thing_name: str):
        ....

    @blp.response()
    def delete(self, thing_name: str):
        ....

Check flask routes, looks fine:

❯ flask routes
Endpoint                     Methods        Rule
---------------------------  -------------  -------------------------------------
Monitoring.Monitoring        GET            /api/monitoring
Thing.ThingView              DELETE, PATCH  /api/thing/<string:thing_name>
Thing.ThingsView             POST           /api/thing

Check routes under sls wsgi flask local, the routes are only GET, not DELETE/PATCH:

❯ sls wsgi flask local --command routes
SERVERLESS_ENTERPRISE {"type": "transaction", "origin": "sls-agent", "payload": {"duration": 21.068811416625977, "endTime": "2020-03-26T12:20:51.634020Z", "logs": {}, "operationName": "s-transaction-function", "schemaType": "s-span", "schemaVersion": "0.0", "spanContext": {"spanId": "129d2eb3-8449-4e16-bf0e-2704f9e8a1fb", "traceId": "1234567890", "xTraceId": null}, ......., "requestId": "1234567890", "schemaVersion": "0.0", "timestamp": "2020-03-26T12:20:51.634020Z"}

[
    0,
    "Endpoint                     Methods  Rule\n---------------------------  -------  -------------------------------------
Monitoring.Monitoring        
GET      /api/monitoring\nThing.ThingView              
GET      /api/thing/<string:thing_name>\nThing.ThingsView    "
]

Now if I disable sls enterprise by commenting out app/org in my serverless.yml, all is well:

❯ sls wsgi flask local --command routes
Endpoint                     Methods        Rule
---------------------------  -------------  -------------------------------------
Monitoring.Monitoring        GET            /api/monitoring
Thing.ThingView              DELETE, PATCH  /api/thing/<string:thing_name>
Thing.ThingsView             POST           /api/thing

So something is really crazy between enterprise and wsgi.

@logandk
Copy link
Owner

logandk commented May 17, 2020

Yeah, I still haven't gotten around to dig into those Serverless Enterprise issues. Have you managed to get around #124, since you're now getting this new issue?

@revmischa
Copy link
Contributor Author

I haven't yet, had to disable enterprise on some apps

@Dizzzmas
Copy link

The issue is still present. Had to disable sls enterprise today to get my app working properly again

scouredimage added a commit to serverless/dashboard-plugin that referenced this issue Jun 29, 2020
Simplifies Flask instrumentation by hooking into `dispatch_request`.
This is less error prone than the earlier approach of overloading
`add_url_rule` and supports Blueprints and Pluggable Views.

Fixes logandk/serverless-wsgi#130
scouredimage added a commit to serverless/dashboard-plugin that referenced this issue Jun 30, 2020
Simplifies Flask instrumentation by hooking into `dispatch_request`.
This is less error prone than the earlier approach of overloading
`add_url_rule` and supports Blueprints and Pluggable Views.

Fixes logandk/serverless-wsgi#130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants