Hello I am setting up the extractor of youtube an...
# troubleshooting
r
Hello I am setting up the extractor of youtube analytics following is the meltano code Tap
Copy code
config:
      channel_ids: xxx      
      start_date: '2000-01-01T00:00:00Z'
      user_agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
When I run test command ``meltano config tap-youtube-analytics test` then i am getting message
Plugin configuration is valid
I am targeting it to postgres and jsonl but in both I am getting following error.
Copy code
{"time": "2024-07-27 22:00:33,466", "level": "INFO", "message": "{'consumer': True, 'producer': False, 'string_id': 'target-postgres_1_20240623163915', 'cmd_type': 'elb', 'run_id': 'def5c761-aff2-4b1f-8403-e5d076aa2281', 'job_name': 'prod:tap-youtube-analytics_1_20240727214656-to-target-postgres_1_20240623163915', 'stdio': 'stderr', 'name': 'target-postgres_1_20240623163915', 'event': '2024-07-27 22:00:33,465 | INFO     | target-postgres      | Emitting completed target state {"bookmarks": {"playlist_items": "2022-10-02T10:28:16.000000Z"}, "currently_syncing": "videos"}', 'level': 'info', 'timestamp': '2024-07-27T16:30:33.466670Z'}"}
{"time": "2024-07-27 22:00:33,813", "level": "INFO", "message": "{'event': 'Incremental state has been updated at 2024-07-27 16:30:33.813578.', 'level': 'info', 'timestamp': '2024-07-27T16:30:33.813710Z'}"}
{"time": "2024-07-27 22:00:33,815", "level": "INFO", "message": "{'consumer': True, 'producer': False, 'string_id': 'target-postgres_1_20240623163915', 'cmd_type': 'elb', 'run_id': 'def5c761-aff2-4b1f-8403-e5d076aa2281', 'job_name': 'prod:tap-youtube-analytics_1_20240727214656-to-target-postgres_1_20240623163915', 'stdio': 'stdout', 'name': 'target-postgres_1_20240623163915', 'event': '{"bookmarks": {"playlist_items": "2022-10-02T10:28:16.000000Z"}, "currently_syncing": "videos"}', 'level': 'info', 'timestamp': '2024-07-27T16:30:33.815371Z'}"}
{"time": "2024-07-27 22:00:33,969", "level": "ERROR", "message": "Extractor failed"}
{"time": "2024-07-27 22:00:33,979", "level": "ERROR", "message": "{'set_number': 0, 'block_type': 'ExtractLoadBlocks', 'success': False, 'err': RunnerError('Extractor failed'), 'exit_codes': {<PluginType.EXTRACTORS: 'extractors'>: 1}, 'event': 'Block run completed.', 'level': 'error', 'timestamp': '2024-07-27T16:30:33.979070Z'}"}
But when I see in posgres database then table database is created and data is also inserted. But the only issue is I am not getting success and instead of that I am getting error. Can anyone help me what I am doing wrong in configuration ? Thanks in advance.
r
What happens when you run
Copy code
meltano invoke tap-youtube-analytics
?
r
Hi @Reuben (Matatika) I am getting following error
Copy code
CRITICAL 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/meltano_project_1_a4ayc_80_O/.meltano/extractors/tap-youtube-analytics/venv/bin/tap-youtube-analytics", line 10, in <module>
    sys.exit(main())
  File "/meltano_project_1_a4ayc_80_O/.meltano/extractors/tap-youtube-analytics/venv/lib/python3.8/site-packages/singer/utils.py", line 229, in wrapped
    return fnc(*args, **kwargs)
  File "/meltano_project_1_a4ayc_80_O/.meltano/extractors/tap-youtube-analytics/venv/lib/python3.8/site-packages/tap_youtube_analytics/__init__.py", line 48, in main
    sync(client=client,
  File "/meltano_project_1_a4ayc_80_O/.meltano/extractors/tap-youtube-analytics/venv/lib/python3.8/site-packages/tap_youtube_analytics/sync.py", line 554, in sync
    total_records = sync_videos(client=client,
  File "/meltano_project_1_a4ayc_80_O/.meltano/extractors/tap-youtube-analytics/venv/lib/python3.8/site-packages/tap_youtube_analytics/sync.py", line 306, in sync_videos
    video_id = search_record.get('id', {}).get('videoId')
AttributeError: 'NoneType' object has no attribute 'get'
r
It's probably a tap bug. You can see where it yields
None
when there are no paginated results (resulting in your
'NoneType' object has no attribute 'get'
error), instead of not yielding anything in that case: https://github.com/singer-io/tap-youtube-analytics/blob/48ccd6df59f6b90dab5069146825f7157d275bc4/tap_youtube_analytics/client.py#L178-L179
👍 2