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

Can't use confluence source #408

Closed
EgorKraevTransferwise opened this issue Oct 4, 2024 · 2 comments
Closed

Can't use confluence source #408

EgorKraevTransferwise opened this issue Oct 4, 2024 · 2 comments

Comments

@EgorKraevTransferwise
Copy link

Hi, when I run the below code it gives me the below exception, and the log file is empty. PyAirbyte version is

I tried pip install airbyte-source-confluence and the package exists and is installing, but firstly it doesn't help with the below error, and secondly it requires Pydantic 1.0 when as far as I can tell the latest PyAirbyte (and langchain 0.3, etc) requires Pydantic 2.0.

The confluence config values I use work fine directly with the confluence-python-api package.

Python 3.10 on Windows, airbyte package versions are

airbyte==0.17.9
airbyte-api==0.49.4
airbyte-cdk==5.10.2
airbyte-protocol-models==0.5.1
airbyte_protocol_models_dataclasses==0.13.0
airbyte_protocol_models_pdv2==0.13.0

Can you please help me make this work?
E.

import os
import airbyte as ab

from dotenv import load_dotenv

envpath = os.path.realpath("../../.env")
load_dotenv(os.path.realpath("envpath"))

source = ab.get_source(
    "source-confluence",
    config={
        "domain_name": "mydomain.atlassian.net",
        "email": "my.username@transferwise.com",
        "api_token": os.getenv("ATLASSIAN_KEY"),
    },
    streams=["pages"],
)

read_result = source.read()
Writing PyAirbyte logs to file: C:\Users\EGORKR~1\AppData\Local\Temp\airbyte\logs\2024-10-04\airbyte-log-J9BKACABS.log
Writing `source-confluence` logs to file: C:\Users\EGORKR~1\AppData\Local\Temp\airbyte\logs\source-confluence\source-confluence-log-J9BKACACN.log
Traceback (most recent call last):
  File "C:\Users\...\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\...\lib\site-packages\airbyte\_util\temp_files.py", line 42, in as_temp_files
    yield [file.name for file in temp_files]
  File "C:\Users\...\lib\site-packages\airbyte\sources\base.py", line 209, in _discover
    for msg in self._execute(["discover", "--config", config_file]):
  File "C:\Users\...\lib\site-packages\airbyte\_connector_base.py", line 449, in _execute
    raise exc.AirbyteConnectorFailedError(
airbyte.exceptions.AirbyteConnectorFailedError: Connector failed. (AirbyteConnectorFailedError)
------------------------------------------------------------
AirbyteConnectorFailedError: Connector failed.
    Please review the log file for more information.
    Connector Name: 'source-confluence'
    Log file: C:\Users\...\AppData\Local\Temp\airbyte\logs\source-confluence\source-confluence-log-J9BKACACN.log
------------------------------------------------------------
Caused by: None is not of type 'string'
@aaronsteers
Copy link
Contributor

@EgorKraevTransferwise - Hi!

Can you confirm that os.getenv("ATLASSIAN_KEY") is returning a value after the dotenv load?

If that is not the issue, can you also try running source.print_config_spec() and source.validate() before the call to read()? This will help us determine if something else is wrong with the connector.

PS - Always great to run into folks from Transferwise. I'm a fan of Pipelinewise and have always enjoyed working with Wise team members I've run into.

@EgorKraevTransferwise
Copy link
Author

Thanks a lot for the quick reply! Just realized that "envpath" inside the load_dotenv() call above should not have quotes around it, when I removed them it all works like a charm! So much for late evening coding :)

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

2 participants