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

Auth Header required Error , even when api key is provided #1628

Closed
Suksham-sharma opened this issue Jan 16, 2024 · 16 comments
Closed

Auth Header required Error , even when api key is provided #1628

Suksham-sharma opened this issue Jan 16, 2024 · 16 comments
Labels
needs more info This issue needs a minimal complete and verifiable example

Comments

@Suksham-sharma
Copy link

so i was using meilisearch with nestJs , i hosted it on Azure , but i was get auth header missing error , i seeked support on discord .

The main issue is when i open the hosted instance on azure directly , on web and then enter api key , it works fine , and the system also works on localhost , but on azure hosted , when i send a request , i get missing auth header in nestJs

this._client = new MeiliSearch({
      host: 'myAzureUrl',
      apiKey: 'myApiKey',
    });

This is the way i'm providing ApiKey and Url , Please Check
image

@curquiza
Copy link
Member

curquiza commented Jan 16, 2024

Hey

Looks like your issue is more related to a support need and not a request for feature or a bug fix.

You might have noticed when opening the issue we don't do support in this repo anymore.

Capture d’écran 2023-10-11 à 16 56 38

We are a small team, so we can’t spend much time doing support this specific repo anymore 😢 Plus I'm not sure this issue is related to this client since it works locally.

I would recommend going to our Discord instead. The community will be able to help you, no matter your question.

Thanks for using Meilisearch!

@curquiza curquiza added the support Issues related to support questions. label Jan 16, 2024
@ericc59
Copy link

ericc59 commented Jan 16, 2024

I'm having the same issue. If I curl with the API key, the request works. When I use the node sdk and provide the same api key, I receive this error.

Using v0.37.0

@curquiza curquiza reopened this Jan 16, 2024
@curquiza curquiza removed the support Issues related to support questions. label Jan 16, 2024
@curquiza
Copy link
Member

In this case, can someone provide a reproducible example?

Also, any fix will be welcome 🙏

@curquiza
Copy link
Member

Do you have the same issue a previous release of meilisearch-js?

@curquiza curquiza added the bug Something isn't working label Jan 16, 2024
@ericc59
Copy link

ericc59 commented Jan 16, 2024

I've tried all versions from 0.24.0 to 0.37.0 and have the same issue with all of them.

@ericc59
Copy link

ericc59 commented Jan 16, 2024

Some more context:

I'm running the self-hosted version of meilisearch using Docker on AWS ECS. It was working yesterday, but after redeploying today, I'm now receiving the Authorization header error.

If I switch my host & key to a meilisearch cloud project instead of my self-hosted server, it works as expected.

@Suksham-sharma
Copy link
Author

It works fine when you use it locally even with the Api-Key ,but somehow not works with same approach on Azure

@curquiza
Copy link
Member

If it work fine locally, definitely it's not related to this client to me.

I'm running the self-hosted version of meilisearch using Docker on AWS ECS. It was working yesterday, but after redeploying today, I'm now receiving the Authorization header error.

Hard to debug without more information 😬 What did you changed in the deployment? Did you upgrade to a new Meilisearch version?

I think both of you could find more help & support on our Discord

@curquiza curquiza added needs more info This issue needs a minimal complete and verifiable example and removed bug Something isn't working labels Jan 17, 2024
@ericc59
Copy link

ericc59 commented Jan 17, 2024

I didn't change anything. I just redeployed the same docker image getmeili/meilisearch:v1.5

@ericc59
Copy link

ericc59 commented Jan 17, 2024

I can DM you the url and api key for the server if it's helpful for testing

@Suksham-sharma
Copy link
Author

Are you using full url for the host ? , I was using it directly without http / https , it was taking it http on its own , and was causing the issue , changing it https made it right , so please check if this minor thing helps @ericc59

@ericc59
Copy link

ericc59 commented Jan 18, 2024

I am using the full url for the host

@curquiza
Copy link
Member

I'm still not able to reproduce the bug, we need a reproducible example as asked here, otherwise it's impossible to debug, so to fix 😢

@ericc59
Copy link

ericc59 commented Jan 29, 2024

@curquiza I just looked into this again and it turns out I'm an idiot and wasn't providing the full host url.

You may want to consider adding a warning or error if the provided host is missing the scheme.

To reproduce, just remove https:// from the host and you should see the authorization header error.

@Suksham-sharma
Copy link
Author

mentioned it in the documentation issues , so it could be updated there

@curquiza
Copy link
Member

Thanks @ericc59 for coming back to us with the information 😊

Thanks @Suksham-sharma for the help and the issue on the docs side. The maintainer of the docs will take this into account.

Closing this issue then, since an issue is in the docs now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue needs a minimal complete and verifiable example
Projects
None yet
Development

No branches or pull requests

3 participants