Hello all, I am trying to implement tap-gmail bu...
# troubleshooting
m
Hello all, I am trying to implement tap-gmail but not able to test the tap as when i am running, it's throwing below error.
Copy code
[7:27 PM] Catalog discovery failed: command ['/Users/monika/Documents/salesoft/tap-gmail/.meltano/extractors/tap-gmail/venv/bin/tap-gmail', '--config', '/Users/monika/Documents/salesoft/tap-gmail/.meltano/run/tap-gmail/tap.486a154a-06cf-4728-a7d2-a962ab00998f.config.json', '--discover'] returned 1
anybody have any idea or the correct way or the necessary thing we need to set up tap-gmail. This is my meltano.yml file
Copy code
version: 1
send_anonymous_usage_stats: true
project_id: d9d78951-903c-4032-80e4-f4af4a3d1de2
plugins:
  extractors:
  - name: tap-gmail
    namespace: tap_gmail
    pip_url: git+<https://github.com/Mashey/tap-gmail>
    executable: tap-gmail
    config:
      ADMIN_SDK_KEY: /Users/monika/Documents/salesoft/tap-gmail/gmail.json
I removed the catalog and discover.
p
hey @monika_rajput ! You can try set the log level to debug and rerun it to understand what part is causing the discovery to fail https://docs.meltano.com/reference/command-line-interface#debugging
m
Thank you @pat_nadolny, I run the debug command , it's throwing this error.
Copy code
the JSON object must be str, bytes or bytearray, not NoneType
tap-gmail        |     from tap_gmail.reports_api_helpers import *
tap-gmail        |   File "/Users/monika/Documents/salesoft/tap-gmail/.meltano/extractors/tap-gmail/venv/lib/python3.8/site-packages/tap_gmail/reports_api_helpers.py", line 5, in <module>
tap-gmail        |     from tap_gmail.reports_service import *
tap-gmail        |   File "/Users/monika/Documents/salesoft/tap-gmail/.meltano/extractors/tap-gmail/venv/lib/python3.8/site-packages/tap_gmail/reports_service.py", line 8, in <module>
tap-gmail        |     SERVICE_ACCOUNT_FILE_JSON = json.loads(SERVICE_ACCOUNT_FILE)
tap-gmail        |   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 341, in loads
tap-gmail        |     raise TypeError(f'the JSON object must be str, bytes or bytearray, '
tap-gmail        | TypeError: the JSON object must be str, bytes or bytearray, not NoneType
target-csv       | INFO Sending version information to <http://singer.io|singer.io>. To disable sending anonymous usage data, set the config parameter "disable_collection" to true
meltano          | DEBUG Deleted configuration at /Users/monika/Documents/salesoft/tap-gmail/.meltano/run/elt/2022-02-14T144025--tap-gmail--target-csv/1e9cfc0d-452b-4f53-9309-941710d7063a/target.da7795f8-ca6a-45c0-92de-ee5957d51220.config.json
meltano          | DEBUG Deleted configuration at /Users/monika/Documents/salesoft/tap-gmail/.meltano/run/elt/2022-02-14T144025--tap-gmail--target-csv/1e9cfc0d-452b-4f53-9309-941710d7063a/tap.b2235d75-e3d6-4ee8-a0c2-2973460d97ea.config.json
meltano          | ERROR Extraction failed (1): TypeError: the JSON object must be str, bytes or bytearray, not NoneType
meltano          | DEBUG ELT could not be completed: Extractor failed
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/meltano/cli/elt.py", line 239, in _run_elt
    await _run_extract_load(elt_context, output_logger)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/meltano/cli/elt.py", line 277, in _run_extract_load
Error
the JSON object must be str, bytes or bytearray, not NoneType
Something wrong in SERVICE_ACCOUNT_FILE_JSON = json.loads(SERVICE_ACCOUNT_FILE)
p
I havent used this tap myself but it looks like its expecting your
ADMIN_SDK_KEY
to be a json string https://github.com/Mashey/tap-gmail/blob/2a9396de686361de584176a3673618fca5efdfa9/tap_gmail/reports_service.py#L8
and to be set as an environment variable instead of a config key
m
Thank you @pat_nadolny, it helps a lot.