Akeneo v5.0.22 Cannot make POST request error 422

Keywords: Akeneo - Microsoft Azure - Technical issue - Other
bnsupport ID: Unknown error while running /tmp/nami
Description:
I created my Akeneo virtual machine using Bitnami Launchpad for Microsoft Azure with default configurations. I am able to log into the Akeneo Dashboard from this newly created Virtual Machine. I have made a new connection and have been following the steps for “Getting Started - Your very first tutorial” found here: https://api.akeneo.com/getting-started/your-first-tutorial-4x/welcome.html. I am using POSTMAN and walking through the steps to making the first connection. My configuration is set up properly in POSTMAN and have entered my information for my client id, client secret, username and password.

However, I am getting error code 422: “message”: “Parameter “client_id” is missing or does not match any client, or secret is invalid”.

I have been following the steps in the troubleshooting docs from https://api.akeneo.com/documentation/troubleshooting.html detailing to add the line “SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1” in my virtual host configuration file for bitnami.

I have attempted to add this line in all various virtual host configuration files in the folders vhost and bitnami by SSHing into the azure bitnami virtual box.

However, the change has not taken any effect to my POST request to the machine. I have gone through all of the default steps with setting up my Akeneo machine, nothing is customized or altered from your steps to get it installed.

I cant imagine that I should have to alter anything from the default configuration and set up I went through from your Bitnami Akeneo instructions.

Please let me know how to fix this error code 422 and if there is a specific virtual host file and where I need to add the line SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1. I see there are multiple virtual host configuration files for bitnami. I have tested entering that line in all tags and I have not had any luck. Please also let me know if there is another fix or additional configuration I need to do. I’ve had multiple developers attempt to create POST requests with your steps you provide for POSTMAN and none have worked.

Thank you please get back to me soon!

Hi @jacques,

Thank you for using the Bitnami solution. Can you take a look at this other thread in this forum in which another user explained how he solved the problem?

Please note that the configuration files inside the solution have slightly changed. You now need to include the “SetEnvIf” line inside the /opt/bitnami/apache/conf/vhosts/akeneo-vhost.conf and /opt/bitnami/apache/conf/vhosts/akeneo-https-vhost.conf files.

Happy to help!


Was my answer helpful? Click on :heart:

Hello @jota,

Unfortunately I am still getting error code: 422 after making the recommended changes.

Here are my files:

/opt/bitnami/apache/conf/vhosts/akeneo-https-vhost.conf
/opt/bitnami/apache/conf/vhosts/akeneo-vhost.conf

I have tried combinations of adding the line "SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1 in various config files in:

/opt/bitnami/apache/conf/vhosts/
/opt/bitnami/apache/conf/bitnami/
/opt/bitnami/apache2/conf/vhosts/
/opt/bitnami/apache2/conf/bitnami/

But have not had any luck with making a POST request using the ‘Your very first collection’ tutorial. All results in error 422 unfortunately.

Any detailed instructions or input If I am entering the line in an incorrect location inside of the files will be greatly appreciated. Guessing and checking has been very time consuming.

Thank you for your help,
Jacques Fracchia

Hi @jacques,

Can you try moving the SetEnvIf line to the beginning of the VirtualHost section? Remember to restart Apache for changes to take effect

sudo /opt/bitnami/ctlscript.sh restart apache

Apart from that, the 422 HTTP code means the request was received properly, but it wasn’t processed by the backend. Can you check with the Akeneo developers on how to debug the cause of this HTTP code?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422

Hello @gongomgra,

I feel dumb I wasn’t restarting apache correctly after each change I made.

Moving the code to the top of and restarting apache with that line you provided fixed my error and allowed me to make a POST request.

You can close this ticket.

Thank you so much for your time and patience!
Jacques Fracchia

Hi @jacques,

Thanks for the info. I’m glad you fixed your issue! We will close this thread as solved. Please do not hesitate to open a new one with any other questions you may have.