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

Integration Issue: Zulip Connector Fails to Determine Tempfile Directory #1452

Open
sebastianelsner opened this issue May 13, 2024 · 0 comments

Comments

@sebastianelsner
Copy link

I was trying to integrate danswer with Zulip but am running into an issue:

danswer-stack-background-1              | 05/13/2024 02:30:31 PM      run_indexing.py  71 : [Attempt ID: 2] Unable to instantiate connector due to Could not determine tempfile directory
danswer-stack-background-1              | Traceback (most recent call last):
danswer-stack-background-1              |   File "/app/danswer/background/indexing/run_indexing.py", line 60, in _get_document_generator
danswer-stack-background-1              |     runnable_connector, new_credential_json = instantiate_connector(
danswer-stack-background-1              |                                               ^^^^^^^^^^^^^^^^^^^^^^
danswer-stack-background-1              |   File "/app/danswer/connectors/factory.py", line 112, in instantiate_connector
danswer-stack-background-1              |     new_credentials = connector.load_credentials(credentials)
danswer-stack-background-1              |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
danswer-stack-background-1              |   File "/app/danswer/connectors/zulip/connector.py", line 50, in load_credentials
danswer-stack-background-1              |     raise Exception("Could not determine tempfile directory")
danswer-stack-background-1              | Exception: Could not determine tempfile directory
danswer-stack-background-1              | 05/13/2024 02:30:31 PM      run_indexing.py 388 : [Attempt ID: 2] Indexing job with ID '2' failed due to Could not determine tempfile directory
danswer-stack-background-1              | Traceback (most recent call last):
danswer-stack-background-1              |   File "/app/danswer/background/indexing/run_indexing.py", line 380, in run_indexing_entrypoint
danswer-stack-background-1              |     _run_indexing(db_session, attempt)
danswer-stack-background-1              |   File "/app/danswer/background/indexing/run_indexing.py", line 168, in _run_indexing
danswer-stack-background-1              |     doc_batch_generator, is_listing_complete = _get_document_generator(
danswer-stack-background-1              |                                                ^^^^^^^^^^^^^^^^^^^^^^^^
danswer-stack-background-1              |   File "/app/danswer/background/indexing/run_indexing.py", line 73, in _get_document_generator
danswer-stack-background-1              |     raise e
danswer-stack-background-1              |   File "/app/danswer/background/indexing/run_indexing.py", line 60, in _get_document_generator
danswer-stack-background-1              |     runnable_connector, new_credential_json = instantiate_connector(
danswer-stack-background-1              |                                               ^^^^^^^^^^^^^^^^^^^^^^
danswer-stack-background-1              |   File "/app/danswer/connectors/factory.py", line 112, in instantiate_connector
danswer-stack-background-1              |     new_credentials = connector.load_credentials(credentials)
danswer-stack-background-1              |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
danswer-stack-background-1              |   File "/app/danswer/connectors/zulip/connector.py", line 50, in load_credentials
danswer-stack-background-1              |     raise Exception("Could not determine tempfile directory")
danswer-stack-background-1              | Exception: Could not determine tempfile directory

As far as I can see this place is the culprit.

https://github.com/danswer-ai/danswer/blame/546815dc8cf462a8b8aedf729fbd2897804ea5e0/backend/danswer/connectors/zulip/connector.py#L50`

Looking at the python docs, tempfile.tempdir will allways be None

If tempdir is None (the default) at any call to any of the above functions except gettempprefix() it is initialized following the algorithm described in gettempdir().

So the tempdir value is not initialized anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant