microsoft / azurechat

🤖 💼 Azure Chat Solution Accelerator powered by Azure Open AI Service
MIT License
1.23k stars 1.2k forks source link

Fetch failed error when trying to upload a file #204

Open MuratYasartas opened 1 year ago

MuratYasartas commented 1 year ago

Hi guys

I'm facing an issue not sure what can be the cause, i'm interested about the document intelligence function, have fulfilled all the env. variable regarding that in my azure properties page

Model is working great with no issue but anytime I try to upload a file I got the "fetch failed" message

No more information and I'm not really sure how to get more info

I have checked and my env. variable look correct, the api key, the endpoint are all ok but still same issue at the end

Also the indexer is not created automatically so I created one, not sure if this is related

Attached the picture o the error

thanks for your help MicrosoftTeams-image (1)

thivy commented 1 year ago

@MuratYasartas are you still facing this error? Could you please make sure you have the latest version of the code and also make sure that the Document intelligence endpoints are configured correctly?

If you are still facing this error are you able to provide the logs from your VSCode console?

schneutzi-81 commented 1 year ago

Hi, I am running in the same problem.

nacartwright commented 1 year ago

Same issue here.

nacartwright commented 1 year ago

I got this to work. I had to use the admin key for the Cognitive Search for some reason.

schneutzi-81 commented 1 year ago

I got it working. I am not sure why. Cli deploy and a new indexer helped.

MuratYasartas commented 1 year ago

Hi guys, will give it a try with the admin key for Cognitive and CLI deploy, I update you there as soon as I got an update

MuratYasartas commented 1 year ago

@schneutzi-81 can you guide me on how to create a new indexer? Mine is not creating automatically and not sure what are the options to be added in.

@nacartwright admin key didn't helped in that situation

jonopryororro commented 1 year ago

We are also looking for assistance on the indexer configuration. It does not seem to be automatically created with any of the deployment methods and we are a little stuck.

ShaunMaher commented 1 year ago

Worked out the hard way...

AZURE_SEARCH_NAME should be set to just the part of the endpoint URL between https:// and .search.windows.net, NOT the whole endpoint URL. The doco is a bit ambiguous and/or my reading comprehension is weak.

danvdb24 commented 1 year ago

@ShaunMaher Thank you very much! It helps. However, can you explain me/us how to create the index and indexer as it is not created automatically. @schneutzi-81

ShaunMaher commented 1 year ago

@danvdb24

I think the idea is that if you have the search service setup correctly, you shouldn't need to setup the index yourself. The application will do it itself.

I have had a look at what is setup on my search service (which is now working) and:

For reference, again, because you shouldn't need it, my Index fields look like this:

[
  {
    "name": "id",
    "type": "Edm.String",
    "searchable": true,
    "filterable": true,
    "retrievable": true,
    "sortable": true,
    "facetable": true,
    "key": true,
    "indexAnalyzer": null,
    "searchAnalyzer": null,
    "analyzer": null,
    "normalizer": null,
    "dimensions": null,
    "vectorSearchConfiguration": null,
    "synonymMaps": []
  },
  {
    "name": "user",
    "type": "Edm.String",
    "searchable": true,
    "filterable": true,
    "retrievable": true,
    "sortable": true,
    "facetable": true,
    "key": false,
    "indexAnalyzer": null,
    "searchAnalyzer": null,
    "analyzer": null,
    "normalizer": null,
    "dimensions": null,
    "vectorSearchConfiguration": null,
    "synonymMaps": []
  },
  {
    "name": "chatThreadId",
    "type": "Edm.String",
    "searchable": true,
    "filterable": true,
    "retrievable": true,
    "sortable": true,
    "facetable": true,
    "key": false,
    "indexAnalyzer": null,
    "searchAnalyzer": null,
    "analyzer": null,
    "normalizer": null,
    "dimensions": null,
    "vectorSearchConfiguration": null,
    "synonymMaps": []
  },
  {
    "name": "pageContent",
    "type": "Edm.String",
    "searchable": true,
    "filterable": true,
    "retrievable": true,
    "sortable": true,
    "facetable": true,
    "key": false,
    "indexAnalyzer": null,
    "searchAnalyzer": null,
    "analyzer": null,
    "normalizer": null,
    "dimensions": null,
    "vectorSearchConfiguration": null,
    "synonymMaps": []
  },
  {
    "name": "metadata",
    "type": "Edm.String",
    "searchable": true,
    "filterable": true,
    "retrievable": true,
    "sortable": true,
    "facetable": true,
    "key": false,
    "indexAnalyzer": null,
    "searchAnalyzer": null,
    "analyzer": null,
    "normalizer": null,
    "dimensions": null,
    "vectorSearchConfiguration": null,
    "synonymMaps": []
  },
  {
    "name": "embedding",
    "type": "Collection(Edm.Single)",
    "searchable": true,
    "filterable": false,
    "retrievable": true,
    "sortable": false,
    "facetable": false,
    "key": false,
    "indexAnalyzer": null,
    "searchAnalyzer": null,
    "analyzer": null,
    "normalizer": null,
    "dimensions": 1536,
    "vectorSearchConfiguration": "vectorConfig",
    "synonymMaps": []
  }
]
ShaunMaher commented 1 year ago

My colleague @jonopryororro just reminded me, I think you also need to have Semantic Search enabled on the Search Service. This is not available on the Free Tier of the Search Service unfortunately.

Once you add the paid for Search Service, find "Semantic Search (Preview)" in the menu on the left (under "Settings") and select a plan. The Free plan here is available and works but you still need to be paying for the Search Service itself.

danvdb24 commented 1 year ago

Thank you so much @ShaunMaher.

I did not use the template nor CLI so I created the resources manually.

Finally I made it work by creating myself :

ianwdunlop commented 1 year ago

I've also got this "fetch failed" problem. The UI doesn't really give much of a clue what the error refers to. I had a look at our cog search service and there doesn't seem to be any index created. Is this because it is failing to talk to the API? I have tried with the admin key in the env vars and had no luck. Are we supposed to manually create the index or not?

UPDATE Got it all sorted out. Was due to IP/firewall restriction issues on our Azure setup.