al_whatmough
11/14/2019, 3:59 AMtap-surveymonkey Singer tap working. I've installed it but when I run the pipeline from the UI I get an error. The error log says:
Traceback (most recent call last):
File "/Code/meltano_test/testproj/.meltano/loaders/target-postgres/venv/bin/target-postgres", line 11, in <module>
load_entry_point('target-postgres==1.1.3', 'console_scripts', 'target-postgres')()
File "/Users/allanwhatmough/Code/meltano_test/testproj/.meltano/loaders/target-postgres/venv/lib/python3.7/site-packages/target_postgres/__init__.py", line 138, in main
state = persist_lines(config, input)
File "/Code/meltano_test/testproj/.meltano/loaders/target-postgres/venv/lib/python3.7/site-packages/target_postgres/__init__.py", line 100, in persist_lines
stream_to_sync[stream] = DbSync(config, o)
File "/Code/meltano_test/testproj/.meltano/loaders/target-postgres/venv/lib/python3.7/site-packages/target_postgres/db_sync.py", line 118, in __init__
self.flatten_schema = flatten_schema(stream_schema_message['schema'])
File "/Code/meltano_test/testproj/.meltano/loaders/target-postgres/venv/lib/python3.7/site-packages/target_postgres/db_sync.py", line 65, in flatten_schema
for k, v in d['properties'].items():
KeyError: 'properties'
CRITICAL [Errno 32] Broken pipe
Traceback (most recent call last):
File "/Code/meltano_test/testproj/.meltano/extractors/tap-surveymonkey/venv/bin/tap-surveymonkey", line 11, in <module>
load_entry_point('tap-surveymonkey==0.1.0', 'console_scripts', 'tap-surveymonkey')()
File "/Code/meltano_test/testproj/.meltano/extractors/tap-surveymonkey/venv/lib/python3.7/site-packages/singer/utils.py", line 229, in wrapped
return fnc(*args, **kwargs)
File "/Code/meltano_test/testproj/.meltano/extractors/tap-surveymonkey/venv/lib/python3.7/site-packages/tap_surveymonkey/__init__.py", line 290, in main
sync(args.config, state, catalog)
File "/Code/meltano_test/testproj/.meltano/extractors/tap-surveymonkey/venv/lib/python3.7/site-packages/tap_surveymonkey/__init__.py", line 149, in sync
mdata)
File "/Code/meltano_test/testproj/.meltano/extractors/tap-surveymonkey/venv/lib/python3.7/site-packages/tap_surveymonkey/__init__.py", line 174, in sync_survey_details
[survey_details]
File "/Code/meltano_test/testproj/.meltano/extractors/tap-surveymonkey/venv/lib/python3.7/site-packages/singer/messages.py", line 248, in write_records
write_record(stream_name, record)
File "/Code/meltano_test/testproj/.meltano/extractors/tap-surveymonkey/venv/lib/python3.7/site-packages/singer/messages.py", line 237, in write_record
time_extracted=time_extracted))
File "/Code/meltano_test/testproj/.meltano/extractors/tap-surveymonkey/venv/lib/python3.7/site-packages/singer/messages.py", line 227, in write_message
sys.stdout.flush()
BrokenPipeError: [Errno 32] Broken pipe
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe
ELT could not complete, an error happened during the process: Subprocesses didn't exit cleanly: tap(120), target(1)al_whatmough
11/14/2019, 4:00 AMmeltano select tap-surveymonkey --list and got this output:
Legend:
selected
excluded
automatic
Enabled patterns:
survey_details.*
Selected properties:al_whatmough
11/14/2019, 4:01 AMproperties.json file to set certain values e.g. additionalProperties on the survey_details JSON object.al_whatmough
11/14/2019, 4:02 AMyannis_roussos
11/14/2019, 12:31 PM# List the available settings for the plugin.
meltano config tap-surveymonkey list
You should be able to see all the configuration parameters you have set.
And then you should be able to see values for all those parameters by running the following:
# Displays the plugin's configuration.
meltano config tap-surveymonkey
For more info on that:
https://www.meltano.com/docs/command-line-interface.html#configyannis_roussos
11/14/2019, 12:41 PMtap-surveymonkey
For example, if you are using the official Singer.io singerio-tap-surveymonkey:
https://github.com/SurveyMonkey/singerio-tap-surveymonkey
I'd expect your meltano.yml to look more or less like the following:
plugins:
extractors:
- capabilities:
- discover
- properties
- state
executable: tap-surveymonkey
name: tap-surveymonkey
namespace: tap_surveymonkey
pip_url: 'git+<https://github.com/SurveyMonkey/singerio-tap-surveymonkey.git>'
settings:
- name: access_token
env: SURVEYMONKEY_ACCESS_TOKEN
- name: start_date
env: SURVEYMONKEY_START_DATE
- name: survey_id
env: SURVEYMONKEY_SURVEY_ID
and you have a .env
export SURVEYMONKEY_ACCESS_TOKEN="EW..."
export SURVEYMONKEY_START_DATE="2017-01-01T00:00:00Z"
export SURVEYMONKEY_SURVEY_ID="112213614"yannis_roussos
11/14/2019, 1:01 PMproperties.json file:
(1) You can check the properties file generated by meltano on .meltano/run/tap-surveymonkey/tap.properties.json
In that way you can check for issues with setting up your tap.
(2) You can copy paste your own working properties.json in there and rename it to tap.properties.json and I think that Meltano will skip on creating a new one and use that instead.
But if you have not properly set the selection rules, we may go in your file and unselect selected streamsyannis_roussos
11/14/2019, 1:08 PMmeltano.yml?yannis_roussos
11/14/2019, 1:10 PMconfig.json you used to make tap-surveymonkey to work on its own? (with the access token value removed of course)yannis_roussos
11/14/2019, 1:11 PMal_whatmough
11/22/2019, 5:33 AMal_whatmough
11/22/2019, 5:34 AMal_whatmough
11/22/2019, 5:35 AMmeltano.yml
plugins:
extractors:
- capabilities:
- discover
- properties
- state
executable: tap-surveymonkey
name: tap-surveymonkey
namespace: tap_surveymonkey
pip_url: git+<https://github.com/SurveyMonkey/singerio-tap-surveymonkey>
settings:
- env: ACCESS_TOKEN
name: access_token
- env: START_DATE
name: start_date
- env: SURVEY_ID
name: survey_idal_whatmough
11/22/2019, 5:43 AM.meltano/run/tap-surveymonkey/tap.properties.json and re-ran it using the CLI, but I'm still seeing this error:
File "/Users/allanwhatmough/Code/meltano_test/testproj/.meltano/loaders/target-postgres/venv/lib/python3.7/site-packages/target_postgres/db_sync.py", line 65, in flatten_schema
for k, v in d['properties'].items():
KeyError: 'properties'yannis_roussos
11/22/2019, 4:12 PMtap-surveymonkey.
The error you get is when target-postgres goes through the schema provided by tap-surveymonkey for one of the extracted Entities and it seems to get an improperly formatted schema (it should have properties).
Can you please run tap-surveymonkey by itself and provide here the schema messages sent?
meltano invoke tap-surveymonkeyal_whatmough
11/29/2019, 6:40 AMmeltano invoke tap-surveymonkeyyannis_roussos
11/29/2019, 10:23 AM