Hello guys! I'm having issues with the Apple App S...
# announcements
j
Hello guys! I'm having issues with the Apple App Store connector. Basically I can't setup the connection because of an error
KeyError: 'private_key'
. I'm trying to start the whole stack with
docker-compose up
and I'm on most recent master,
5dfd81a1
. It seems like the issue was fixed in this PR https://github.com/airbytehq/airbyte/pull/1975, although for whatever reason the webapp is still trying to set the old
key_file
parameter instead of the new
private_key
argument. Do you have any suggestions on how to make the webapp use the most recent specification for the connector? Thanks in advance!
1
s
hey Jakub! do you already have a connection which uses the appstore connector?
if so, you can use the new version by going to the Admin UI (from the left hand navbar) and updating the docker tag of the connector to 0.1.1
j
hi Shrif! no, I don't have any existing connections that utilizes the appstore connector
s
Understood, so all you’ll need to do then is go to the admin UI and change the appstore source’s tag to “0.1.1”
j
Copy code
2021-02-09 17:10:43 INFO (/tmp/workspace/34/0) WorkerRun(call):58 - Executing worker wrapper...
2021-02-09 17:10:43 INFO (/tmp/workspace/34/0) LineGobbler(voidCall):69 - Checking if airbyte/source-appstore-singer:0.1.1 exists...
2021-02-09 17:10:43 INFO (/tmp/workspace/34/0) LineGobbler(voidCall):69 - airbyte/source-appstore-singer:0.1.1 was found locally.
2021-02-09 17:10:43 DEBUG (/tmp/workspace/34/0) DockerProcessBuilderFactory(create):104 - Preparing command: docker run --rm -i -v airbyte_workspace:/data -v /tmp/airbyte_local:/local -w /data/34/0 --network host airbyte/source-appstore-singer:0.1.1 check --config tap_config.json
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - Traceback (most recent call last):
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/jwt/algorithms.py", line 349, in prepare_key
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     key = load_pem_public_key(key, backend=default_backend())
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/primitives/serialization/base.py", line 20, in load_pem_public_key
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     return backend.load_pem_public_key(data)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1071, in load_pem_public_key
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     self._handle_key_loading_error()
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1329, in _handle_key_loading_error
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     raise ValueError("Could not deserialize key data.")
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - ValueError: Could not deserialize key data.
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - 
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - During handling of the above exception, another exception occurred:
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - 
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - Traceback (most recent call last):
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/source_appstore_singer/source.py", line 61, in check_config
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     api = Api(config["key_id"], config["key_file"], config["issuer_id"])
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/appstoreconnect/api.py", line 66, in __init__
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     token = self.token  # generate first token
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/appstoreconnect/api.py", line 337, in token
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     self._token = self._generate_token()
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/appstoreconnect/api.py", line 82, in _generate_token
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     headers={'kid': self.key_id, 'typ': 'JWT'}, algorithm=ALGORITHM).decode('ascii')
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/jwt/api_jwt.py", line 65, in encode
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     json_payload, key, algorithm, headers, json_encoder
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/jwt/api_jws.py", line 113, in encode
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     key = alg_obj.prepare_key(key)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/jwt/algorithms.py", line 351, in prepare_key
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     key = load_pem_private_key(key, password=None, backend=default_backend())
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/primitives/serialization/base.py", line 16, in load_pem_private_key
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     return backend.load_pem_private_key(data, password)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1045, in load_pem_private_key
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     password,
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1271, in _load_key
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     self._handle_key_loading_error()
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1329, in _handle_key_loading_error
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     raise ValueError("Could not deserialize key data.")
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - ValueError: Could not deserialize key data.
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - 
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - During handling of the above exception, another exception occurred:
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - 
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - Traceback (most recent call last):
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/bin/base-python", line 8, in <module>
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     sys.exit(main())
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/base_python/entrypoint.py", line 135, in main
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     launch(source, sys.argv[1:])
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/base_python/entrypoint.py", line 120, in launch
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     AirbyteEntrypoint(source).start(args)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/base_python/entrypoint.py", line 94, in start
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     check_result = self.source.check(logger, config)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/base_singer/source.py", line 107, in check
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     return self.check_config(logger, config_container.config_path, config_container.config)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/source_appstore_singer/source.py", line 73, in check_config
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     logger.warn(e)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/base_python/logger.py", line 55, in warn
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     self.log("WARN", message)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "/usr/local/lib/python3.7/site-packages/base_python/logger.py", line 44, in log
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -     log_record = AirbyteLogMessage(level=level, message=message)
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   File "pydantic/main.py", line 346, in pydantic.main.BaseModel.__init__
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - pydantic.error_wrappers.ValidationError: 1 validation error for AirbyteLogMessage
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 - message
2021-02-09 17:10:44 ERROR (/tmp/workspace/34/0) LineGobbler(voidCall):69 -   str type expected (type=type_error.str)
@s thanks, that fixed the issue, although I'm still not able to setup the connection because of another error `Could not connect with provided credentials`:
message has been deleted
it seems like
appstoreconnect
library is expecting the keyfile to contain line breaks (I was able to replicate the same error by simply removing all
\n
-s from the keyfile and then trying to use it with the library locally) I'm just not sure how to enter the content of the keyfile with linebreaks into the form
j
There’s a pending ticket to resolve this issue: https://github.com/airbytehq/airbyte/issues/2015
j
thanks! I will try the mentioned approach
👍 1