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

API Returning 500 error on successful call #294

Open
1 task done
ShareBtech opened this issue Dec 20, 2022 · 0 comments
Open
1 task done

API Returning 500 error on successful call #294

ShareBtech opened this issue Dec 20, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@ShareBtech
Copy link

Mautic Version

4.2.x series

PHP version

7.4

What browsers are you seeing the problem on?

No response

What happened?

After having installed on 4.4.5 seamlessly I am trying to run some API calls and I see that the actual call is executing the desired result, however I am getting a 500 error back in response:

This is the error I am seeing:

2022/12/19 12:45:07 [error] 47597#47597: *10668 FastCGI sent in stderr: "PHP message: PHP Warning: get_class() expects parameter 1 to be object, int given in /var/www/mautic/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php on line 73" while reading response header from upstream, client: 199.99.99.99, server: mymauitc.com, request: "PATCH /api/contacts/13/edit?includeCustomObjects=true HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "mymauitc.com"
And in the access log:

138.68.137.203 - apiuser [19/Dec/2022:12:45:07 +0000] "PATCH /api/contacts/13/edit?includeCustomObjects=true HTTP/1.1" 500 172 "-" "axios/0.21.4"
And my object looks like this:

{ "customObjects": { "data": [{ "id": 1,"alias": "deposits", "data": [{ "id":"8", "name": "Deposit-DateInputHere", "attributes": { "deposit-date1": "2022/12/29", "deposit-currency": "USD" ,"deposit-amount":"9000", "deposit-brand":"Surge"}}]}] } }
But like I say the object is actually created correctly inside Mautic.

Any ideas ?

Added Test: Set up the exact same custom object and fields in 4.4.5 and ran the same API call and I am getting the 500 error, whereas on 4.4.4 it returns a success.

How can we reproduce this issue?

Step 1:

Relevant log output

2022/12/19 12:45:07 [error] 47597#47597: *10668 FastCGI sent in stderr: "PHP message: PHP Warning:  get_class() expects parameter 1 to be object, int given in /var/www/mautic/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php on line 73" while reading response header from upstream, client: 199.99.99.99, server: mymauitc.com, request: "PATCH /api/contacts/13/edit?includeCustomObjects=true HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "mymauitc.com"

Code of Conduct

  • I confirm that I have read and agree to follow this project's Code of Conduct
@ShareBtech ShareBtech added the bug Something isn't working label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant