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

Finch error #14

Open
cocoaway opened this issue Sep 23, 2022 · 2 comments
Open

Finch error #14

cocoaway opened this issue Sep 23, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@cocoaway
Copy link

Describe the bug
Finch returns an error as if the named domain did not exist.
The cosmos db address is correct.

To Reproduce

container |> CosmosDbEx.get_documents()

Error log

iex(4)> container |> CosmosDbEx.get_documents()
** (FunctionClauseError) no function clause matching in CosmosDbEx.Documents.parse_response/1    
    
    The following arguments were given to CosmosDbEx.Documents.parse_response/1:
    
        # 1
        {:error, %Mint.TransportError{reason: :nxdomain}}
    
    Attempted function clauses (showing 8 out of 8):
    
        defp parse_response({:ok, %Finch.Response{body: body, headers: headers, status: 200}})
        defp parse_response({:ok, %Finch.Response{body: body, headers: headers, status: 201}})
        defp parse_response({:ok, %Finch.Response{status: 400, headers: headers, body: body}})
        defp parse_response({:ok, %Finch.Response{status: 401, headers: headers, body: body}})
        defp parse_response({:ok, %Finch.Response{status: 403, headers: headers, body: body}})
        defp parse_response({:ok, %Finch.Response{status: 404, headers: headers, body: body}})
        defp parse_response({:ok, %Finch.Response{status: 409, headers: headers, body: body}})
        defp parse_response({:ok, %Finch.Response{status: 413, headers: headers, body: body}})
    
    (cosmos_db_ex 0.1.1) lib/cosmos_db_ex/documents.ex:183: CosmosDbEx.Documents.parse_response/1

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Elixir : 1.14.0
  • Erlang : 25.1
@jeramyRR jeramyRR self-assigned this Sep 23, 2022
@jeramyRR jeramyRR added the bug Something isn't working label Sep 23, 2022
@jeramyRR jeramyRR added this to New in Cosmos Db Client for Elixir via automation Sep 23, 2022
@jeramyRR
Copy link
Owner

I do need to add another clause to handle the :nxdomain error. As for Finch not being able to find the domain name, can you confirm real quick that you can connect to the database via Azure Data Studio, or something like that from the same machine?

@cocoaway
Copy link
Author

Yes, confirmed. With Azure Studio data I'm able to connect.

More, tested db downloading Microsoft cosmos db 'connect' sample python app and it works.
I'm able to create and read items in cosmos db 'ToDoList' container (as for Microsoft python example).

So, I can say that cosmos db is up and running and available for python sample app.

Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants