It took less than a week for OpenAI’s ChatGPT to reach a million users, and it crossed the 100 million user mark in under two months. The interest and excitement around this technology has been remar...
After recreating everything from scratch based on pablocastro's comment above, the index has been succesfully created.
Now the script begins to upload the data (PDF files). Looks to me like it fails while creating the HTTP request header (to the Storage service), specifically they key? Not related to the PDF files at all.
Ensuring search index gptkbindex exists Search index gptkbindex already exists Processing files... Processing './data\a northwind traders business plan.pdf' Traceback (most recent call last): File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\authentication.py", line 119, in _add_authorization_header signature = sign_string(self.account_key, string_to_sign) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\__init__.py", line 47, in sign_string key = decode_base64_to_bytes(key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\__init__.py", line 37, in decode_base64_to_bytes return base64.b64decode(data) ^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\base64.py", line 88, in b64decode return binascii.a2b_base64(s, strict_mode=validate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ binascii.Error: Incorrect padding
This cascades as shown below, but really the problem is on binascii.a2b_base64. It is being called with strict=false already (tried hardcoding it to false, same thing).
(continues from above) binascii.Error: Incorrect padding
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Desarrollo\VSCode\ACS\T1\azure-search-openai-demo\scripts\prepdocs.py", line 223, in <module> upload_blobs(pages) File "C:\Desarrollo\VSCode\ACS\T1\azure-search-openai-demo\scripts\prepdocs.py", line 49, in upload_blobs if not blob_container.exists(): ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\tracing\decorator.py", line 78, in wrapper_use_tracer return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_container_client.py", line 538, in exists process_storage_error(error) File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\response_handlers.py", line 93, in process_storage_error raise storage_error File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_container_client.py", line 534, in exists self._client.container.get_properties(**kwargs) File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\tracing\decorator.py", line 78, in wrapper_use_tracer return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_generated\operations\_container_operations.py", line 1055, in get_properties pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_base.py", line 205, in run return first_node.send(pipeline_request) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_base.py", line 69, in send response = self.next.send(request) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_base.py", line 69, in send response = self.next.send(request) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_base.py", line 69, in send response = self.next.send(request) ^^^^^^^^^^^^^^^^^^^^^^^ [Previous line repeated 2 more times] File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\policies\_redirect.py", line 160, in send response = self.next.send(request) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_base.py", line 69, in send response = self.next.send(request) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\policies.py", line 546, in send raise err File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\policies.py", line 520, in send response = self.next.send(request) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_base.py", line 69, in send response = self.next.send(request) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_base.py", line 69, in send response = self.next.send(request) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_base.py", line 67, in send _await_result(self._policy.on_request, request) File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\pipeline\_tools.py", line 35, in await_result result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\authentication.py", line 142, in on_request self._add_authorization_header(request, string_to_sign) File "C:\Users\Andres\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\storage\blob\_shared\authentication.py", line 125, in _add_authorization_header raise _wrap_exception(ex, AzureSigningError) azure.storage.blob._shared.authentication.AzureSigningError: Incorrect padding PS C:\Desarrollo\VSCode\ACS\T1\azure-search-openai-demo>