OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

This topic contains 10 replies, has 2 voices, and was last updated by  Yurii Muratov 6 years ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Author
    Replies
  • #35437

    Chris
    Participant

    Re-reading this, I may have been a little confusing. The value for $noteProvider in line 85 is null and actually has the exception at:

    https://github.com/oroinc/platform/blob/1.8/src/Oro/Bundle/NoteBundle/Form/Handler/NoteApiHandler.php#L91

    when hasConfig() is called. Sorry for any confusion.

    #35438

    Yurii Muratov
    Participant

    Hello, Chris.

    Thank you for reporting the issue. Yes. The issue exists at platform from version 2.0.

    I have created an issue to fix (Internal ID – BAP-16755).

    But, please consider a possibility to use JSON API. It has much more capabilities.

    For example, to create a note with JSON API, you have to call POST request to /api/notes with data in JSON API format:

    Please find more information here: https://oroinc.com/orocrm/doc/2.3/book/data-api and at JSON API specification site: http://jsonapi.org/format/

    #35439

    Chris
    Participant

    Yurii,

    Thank you for the response. I had looked at the json api, however the PATCH method returns a 502 response (bad gateway). Get requests for /api/notes/{id} work and return 200.

    Is this too a known issue?

    #35440

    Yurii Muratov
    Participant

    Hmm, it’s very strange. I have just re-check PATCH request for the notes. And all work for me.

    Could you please tell me what version of the platform do you use? And please send to me full response of your request to be able to better understand the problem.

    Thanks.

    #35441

    Chris
    Participant

    Using the JSON API with PATCH /api/notes/3 I receive the following response headers:

    502 Bad Gateway

    date: Wed, 14 Mar 2018 19:38:08 GMT
    server: nginx/1.12.2
    connection: keep-alive
    content-length: 575
    content-type: text/html

    Please note that GET works just fine.

    #35442

    Yurii Muratov
    Participant

    Hello, Chris.

    Thanks for sending the response headers. But as i can see, the response have body (content-length: 575).
    Could you please send full response with the body?

    Please check if your nginx configuration is correct. There is a blog post that describe how to correct configure nginx for ORO applications https://oroinc.com/orocrm/blog/orocrm-installation-on-server-with-nginx-php-fpm.

    Also please check if log files have any records with errors.

    #35443

    Chris
    Participant

    My request body is:

    {
    “data”:{
    “type”:”notes”,
    “id”:”3″,
    “attributes”:{
    “message”:”Test Message”,
    “subject”:”Test Subject”
    }
    }
    }

    and the response body is:

    <html>
    <head><title>502 Bad Gateway</title></head>
    <body bgcolor=”white”>
    <center><h1>502 Bad Gateway</h1></center>
    <hr><center>nginx/1.12.2</center>
    </body>
    </html>
    <!– a padding to disable MSIE and Chrome friendly error page –>
    <!– a padding to disable MSIE and Chrome friendly error page –>
    <!– a padding to disable MSIE and Chrome friendly error page –>
    <!– a padding to disable MSIE and Chrome friendly error page –>
    <!– a padding to disable MSIE and Chrome friendly error page –>
    <!– a padding to disable MSIE and Chrome friendly error page –>

    I’m unsure of an environment issue being present if the same endpoint works using get.

    #35444

    Yurii Muratov
    Participant

    Chris, thank you for your request body.

    I have tried it on my local environment and see that it is invalid because notes API resource do not have subject attribute. The Oro response on this request is 400 Bad Request with body:

    Please try to send next request:

    And send to me the result of this request.

    It might help to understand the reason of the problem.

    Also, it will be helpful if you will send your nginx configuration because for now i see the problem is in it.

    #35445

    Chris
    Participant

    Using your request here is the response:

    Here is the contents of nginx.conf

    conf.d/proxy.conf (included via nginx.conf)

    sites-enabled/_.conf (via include)

    sites-enabled/nxv_pfxgry0qx28p.conf

    #35446

    Yurii Muratov
    Participant

    Chris, thank you for the configs.

    I will try to reproduce the issue.

    Meanwhile, could you please check ngnix error logs for errors?

Viewing 10 replies - 1 through 10 (of 10 total)

The forum ‘OroPlatform – Installation/Technical Issues or Problems’ is closed to new topics and replies.

Back to top