-
Notifications
You must be signed in to change notification settings - Fork 185
std::runtime_error on macOS when submitting any POST request #721
Comments
Hey @keithbrinks, this looks like a doozy but I’ll do my best to help and see what’s going on. When you attempt a login using the LDAP auth driver, what do you see in your Laravel logs before it crashes? |
Hi @stevebauman, Thanks and I'm also cross posting to the sqlsrv repository as well, so depending which side the issue is on, hopefully we can track it down. It doesn't appear I'm getting much out of the log other than just the connection information:
That's everything from the time I logged in, to submitting a POST request. |
Hmm is your database schema managed by Laravel migrations? And are you able to post your I'm wondering if this is somehow related to the |
I do manage the database via migrations. When I added the
This is the full schema:
But I don't believe this issue is being caused by the objectguid change, as the 502/runtime_error was occurring long before that change was implemented. |
Ok I see... Definitely strange because this line here in your logs indicate that the user is successfully saved:
Which takes place here (after the model save via
Are you using the |
I'm using the For example, I created a simple I then created a form to submit data to this table:
Then added a post route to web.php:
And implemented the store method:
So in this example, submitting "test data" results in the 502/runtime_error when signed in with LDAP. If I am signed out, it works. If I change the auth driver to |
Thanks for clarifying @keithbrinks! Appreciate it. I'm understanding now. That is definitely bizarre... Do you have model binding enabled via the One thing you can try is keeping the Are you calling Adldap2 anywhere in your application at all? Or just using it for the authentication driver? I'm surprised this is happening only on POST requests - extremely strange for sure. |
Yeah, I don't know what's special about the POST requests, or why it would matter if I'm logged in or not. I wouldn't think LDAP is passing any additional data? Or if it has something to do with the response coming back... Because another point of clarification is that while I do get the 502 error, the data submitted DOES get saved to the database. So it is making it... Which makes me think it's something on the response end. I do have model binding enabled on I did as you said with configured the I am using Adldap2 somewhat sporadically. I'm checking if a user object in AD has certain security groups applied to access areas of the application. |
Are you able to remove the model binding trait and test again? You mentioned Vue and API endpoints, are you authenticating via a POST request using Axios and then sending back the returned I'm wondering if this is due to a serialization issue when trying to serialize the LDAP user model that is being set on your |
Hey @stevebauman, I've gotten some responses on issue opened in the msphpsql repo. See here. Seems like an issue from within macOS. Though it's still strange that Adldap2 seems to have something to do with it... No idea. But I have a workaround for now, and they'll implement a fix in the driver itself. I do appreciate the help! |
No problem at all @keithbrinks! Glad to help in any way I can.
That's really weird! What a strange issue...
It definitely seems like that's the case, I'm just so stumped as to what it could be! lol 😅 Does it work okay with the workaround? |
Yeah, I followed their instruction to modify the driver and everything has been working like a charm. I'll go ahead and close this out. Thanks again! |
Great, glad you're up and running! No problem at all 😄 |
Description:
My application uses SQL Server, for which I use the pdo_sqlsrv driver (https://github.com/Microsoft/msphpsql) to connect. Back in December I was attempting to setup Laravel Valet but kept running into the following error:
At that time I submitted a ticket to the msphpsql repository:
microsoft/msphpsql#909
There's also a couple of tickets in the Microsoft Homebrew ODBC repository:
microsoft/homebrew-mssql-release#25
microsoft/homebrew-mssql-release#31
Essentially what happens is that I can perform any kind of request to the database (GET, PATCH, DELETE), but when I submit a POST request, the browser gets a 502 error and the error message above gets put in a crash log.
I had believed the issue was related to either the SQLSRV or ODBC drivers, however earlier I wrote a vanilla PHP script to replicate the issue by POSTing data to the database, only that it worked fine.
So I created a fresh Laravel project and created a model to post data to the database. It also worked fine.
So then I when back to my project but I kept getting the 502 error/error above. Only in one circumstance it DID work. I noticed I wasn't logged in.
So through some troubleshooting, I removed the LDAP package, logged in via the Eloquent auth driver, and I was able to send POST requests without issue.
As soon as I re-added the LDAP package, I started getting the 502 errors again.
I'm not sure if there's an issue with this package and how it's somehow interacting with the SQLSRV/ODBC drivers, or if it's an issue on the SQLSRV/ODBC driver side.
Is there a way we can debug this?
Here is the complete crash report:
Steps To Reproduce:
Would be interesting if it's just me, or reproducible by others:
The text was updated successfully, but these errors were encountered: