Impossible to connect, please check your Algolia Application Id

Hi,
I’m trying to add an Algolia App to my Syfony app (v.4.12.8)
I follow the documentation, everything is okay until ii try to add my App ID and API keys…

Here is my .env

###< algolia> ###
ALGOLIA_APP_ID="NSO85Y6C9K"
ALGOLIA_API_KEY="8db**************************"

When i run :

php bin/console search:import

I got :
Impossible to connect, please check your Algolia Application Id

I’m sure about my APP_ID and API_KEY (copied & paste from the website)
Cache is clear
Nothing in logs…

Any Idea ?
Thank you

Hi @g.furet,

Can you double check that you are using the admin api key and not the search api key?

Let us know how that works for you!

Hi @cindy.cullen thank you for your answer !

I copy this key from the website :

and put it here :

As you can see, it start as the same :
image

I don’t see where my issue can be…

Hi @g.furet,

This command should work indeed with your admin API Key. So that we can try to reproduce this error on our end, could you please give us access to your Algolia dashboard?

You can do so here: https://www.algolia.com/account/support. Please give us 7 days of read access, and let us know in this thread when this is done.

Thanks!

Okay @cindy.cullen , i’ve create a read access for 7 days to Algolia Support.

If i can help you … i run Algolia on a Symfony 4.12.8
My Symfony is on local development computer.
I’m using WAMP with php 7.3.1, cURL is enabled …may be a specific php extension must be installed ?

Thank you

Hi again @g.furet,

Thanks for these details!

I just checked on our side, and we do not have personification access yet to app NSO85Y6C9K, is that indeed the app ID you gave us access to?

Hi @marie.gillier,
As you can see, NSO85Y6C9K is in my applications list :

Tell me if you need more details…

Best regards

Hi @g.furet,

Indeed your credentials are correct. Could you check if maybe in your configuration the environment variables could be overridden, resulting in this error?
Also, what version Algolia SearchBundle are you using? Could you try to make different operation not using the commands but the service directly and see if the error persist?

Thanks a lot

Hi @chloe.liban,

Indeed your credentials are correct. Could you check if maybe in your configuration the environment variables could be overridden, resulting in this error?

i’ve deleted my ApplicationID from .env and the command return parameter missing , so i suppose my env is correctly loaded …

However, how can i check isn’t be overwritted by something ?

Also, what version Algolia SearchBundle are you using?

I’m using the latest version of Algolia, in my composer.json "algolia/search-bundle": "4.0.0",

Could you try to make different operation not using the commands but the service directly and see if the error persist?

I tried to use the Doctrine postUpdate events instead of php command.
This is my algolia_search.yaml :

 algolia_search:

    doctrineSubscribedEvents: ['postPersist','postUpdate','postRemove']

    indices:

        - name: users

          class: App\Entity\User

        - name: taxe

          class: App\Entity\Taxe

When i update a Taxe entity, i got the same error in Symfony dev mode :

In the stack trace error i can find my Application ID in the ApIWrapper :

Thanks you :wink:

Hey @g.furet,

Thanks a lot for all the information you provided us. Unfortunately I really don’t see what could be going wrong, I’ve tested multiple time on my side your credentials and everything looks fine. My guess would be that this could be something going on with WAMP or Symfony Server and their configuration but this is not my field of expertise as we have made the extensions to be used as-is.

I’m keeping this issue open as maybe someone from the community would be able to jump in. Sorry again for your troubles.

Have a good day!

Hi @chloe.liban
I’ve deploy my application on a development server, i’m not using symfony server:start, i use an Apache environment instead.

Same configuration, and it works perfectly… !
So the error probably come from Symfony Server or Wamp

Thank you for your help, i can use algolia now :slight_smile:

Have a nice day

1 Like

The Solution:
1- Download the latest cacert.pem
2- Add the following line to php.ini: curl.cainfo="/path/to/downloaded/cacert.pem" (Make sure you enclose the path within double quotation marks)

source:

2 Likes