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

Error message swallowed in webhook operation #18068

Closed
Militao36 opened this issue Apr 5, 2023 · 10 comments · Fixed by #18080
Closed

Error message swallowed in webhook operation #18068

Militao36 opened this issue Apr 5, 2023 · 10 comments · Fixed by #18080
Assignees

Comments

@Militao36
Copy link

Describe the Bug

I'm having problems, I have a flow, which is called manually. After that I make an HTTP call, but it gives errors, the url used is public, in the browser it works.

URL: https://backend.bmspedidos.com.br/crash

image
image

To Reproduce

  1. Create test flow
  2. Linked flow, with call HTTP
  3. Execute flow

Hosting Strategy

Self-Hosted (Custom)

@paescuj paescuj changed the title Bug flow Incomplete error message check in webhook operation Apr 5, 2023
@paescuj paescuj changed the title Incomplete error message check in webhook operation Error message swallowed in webhook operation Apr 5, 2023
@paescuj
Copy link
Member

paescuj commented Apr 5, 2023

Props like error.response.status might not exist, in that case the actual error message is swallowed by the cannot read properties of undefined error.
First, we should do proper typing, e.g. by checking the error against isAxiosError and then handle properties which might be undefined accordingly.

} catch (error: any) {
throw JSON.stringify({
status: error.response.status,
statusText: error.response.statusText,
headers: error.response.headers,
data: error.response.data,
});
}

@paescuj
Copy link
Member

paescuj commented Apr 5, 2023

/linear

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

🤖 Linear issue created! Maintainers can access it here: ENG-879

@Militao36
Copy link
Author

@paescuj I think you misunderstood, this url publishes, it should return success, accessing it directly works, however the flow doesn't.

@XanManZA
Copy link

XanManZA commented Apr 6, 2023

I want to report in here that I can reproduce this exact error on Directus 9.24.0.

  1. Create new Directus 9.24.0 project with CLI using Postgres as Database
  2. Create a flow with a Webhook action calling just for example /users/me
  3. Get the error Cannot read properties of undefined (reading 'status') in the Flow logs

Findings:

  • This doesn't happen when calling /users/me directly at all through Postman and only happens in Flows.
  • There are no errors in the Directus server logs.
  • Strangely this is not happening on my Docker Compose cloud hosted version of Directus.

@XanManZA
Copy link

XanManZA commented Apr 6, 2023

Ok am I reporting back here that 17906 lead me towards the right path. Setting IMPORT_IP_DENY_LIST to an empty string solved this.

@paescuj
Copy link
Member

paescuj commented Apr 6, 2023

The problem is that the request is failing for some reason (e.g. server temporary unavailable or like Requested URL "https://localhost:8055/users/me" resolves to a denied IP address for the /users/me request) but this error isn't handled correctly at the moment thus it gets swallowed.

@Militao36
Copy link
Author

Militao36 commented Apr 6, 2023

@paescuj @XanManZA The server is always available. When running the flow the server is always available but it fails. Maybe it's because I use nginx reverse proxy, and it generates this error. But about 2 weeks ago it was working, I just updated directus.

Server framework description: I am using expressjs, along with nginx as reverse proxy. My app is always online, I've tested multiple endpoints and none of them work.

@Militao36
Copy link
Author

I downloaded the directus source code and ran the whole flow on my machine, with the same URL it worked, but the directus call I'm using doesn't work. It is in the latest released version

Conditions: I'm using the same bank as my production app (directus).

image

@rijkvanzanten
Copy link
Member

Fixed in #18080

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants