Unable to add certain resources
Adding some resource URLs to a group fails (CreateResource & PreviewResourceLink) without UI feedback.
Preview
Preview (auto-fetching title and description) does not occur. Network Monitor (Developer Tools) shows request {"operationName":"PreviewResourceLink"...}
fails with HTTP 500 (HTML page for temporary downtime; but the server still appears to be up). Front-end UI does not show any error; title and description fields are unchanged. Error appears in console: "We have an apollo error Array [ undefined, 500 ]
Server log (Sentry not configured):
22:09:48.466 request_id=F1DB1ppmPrh5dasAR-FB [info] POST /api
22:09:48.474 request_id=F1DB1ppmPrh5dasAR-FB user_id=1 actor_name=@cel [warning] Failed to send Sentry event. Cannot send Sentry event because of invalid DSN
22:09:48.476 request_id=F1DB1ppmPrh5dasAR-FB user_id=1 actor_name=@cel [info] Sent 500 in 9ms
22:09:48.476 [error] #PID<0.12347.138> running Mobilizon.Web.Endpoint (connection #PID<0.9535.138>, stream id 1) terminated
Server: mobilizon.us:80 (http)
Request: POST /api
** (exit) an exception was raised:
** (CaseClauseError) no case clause matching: {:ok, {:error, :invalid_parsed_data}}
(mobilizon 3.0.3) lib/graphql/resolvers/resource.ex:221: Mobilizon.GraphQL.Resolvers.Resource.preview_resource_link/3
(absinthe 1.7.0) lib/absinthe/resolution.ex:209: Absinthe.Resolution.call/2
(absinthe 1.7.0) lib/absinthe/phase/document/execution/resolution.ex:230: Absinthe.Phase.Document.Execution.Resolution.reduce_resolution/1
(absinthe 1.7.0) lib/absinthe/phase/document/execution/resolution.ex:185: Absinthe.Phase.Document.Execution.Resolution.do_resolve_field/3
(absinthe 1.7.0) lib/absinthe/phase/document/execution/resolution.ex:170: Absinthe.Phase.Document.Execution.Resolution.do_resolve_fields/6
(absinthe 1.7.0) lib/absinthe/phase/document/execution/resolution.ex:88: Absinthe.Phase.Document.Execution.Resolution.walk_result/5
(absinthe 1.7.0) lib/absinthe/phase/document/execution/resolution.ex:67: Absinthe.Phase.Document.Execution.Resolution.perform_resolution/3
(absinthe 1.7.0) lib/absinthe/phase/document/execution/resolution.ex:24: Absinthe.Phase.Document.Execution.Resolution.resolve_current/3
Create
Create resource ({"operationName":"CreateResource"...}
) results in HTTP 200 with error from API:
{"data":{"createResource":null},"errors":[{"code":"validation","field":"metadata","locations":[{"column":3,"line":2}],"message":["is invalid"],"path":["createResource"],"status_code":422}]}
Error ("is invalid") also appears in console:
We have an apollo error Array [ (1) […], undefined ] error-link.ts:24:12
[GraphQL error]: Message: is invalid, Location: [object Object], Path: createResource error-link.ts:86:20
The front-end UI does not show feedback that an error occurred after clicking the Create resource button.
Server log does not show error info:
22:11:41.539 request_id=F1DB8O4M1jIGfH8ALV_C [info] POST /api
22:11:41.551 request_id=F1DB8O4M1jIGfH8ALV_C graphql_operation_name=CreateResource user_id=1 actor_name=@cel [info] Sent 200 in 11ms
Preview and adding resource works with some other URLs, including on the same host. Maybe some HTML structure is required? (Edit: HTML validation passes.) Remote server shows the requests successfully served (HTTP 200).
Mobilizon 3.0.3