sudeep_puvadi
12/08/2022, 6:05 PMSven Balnojan
12/08/2022, 7:50 PMsudeep_puvadi
12/08/2022, 7:51 PMsudeep_puvadi
12/08/2022, 7:53 PMSven Balnojan
12/08/2022, 7:56 PMvisch
12/08/2022, 7:57 PMsudeep_puvadi
12/08/2022, 7:57 PMsudeep_puvadi
12/08/2022, 7:58 PMpat_nadolny
12/09/2022, 1:19 AMpat_nadolny
12/09/2022, 1:29 AMschema: ./locations.json
that you're passing in is invalid. What error did you get in the first screenshot you shared when it inferred the schema? This is an example of a valid schema that was produced as part of testing that ^^ earthquake example I shared above
```{
"streams": [
{
"tap_stream_id": "us_earthquakes",
"replication_method": "FULL_TABLE",
"key_properties": [
"id"
],
"schema": {
"properties": {
"type": {
"type": "string"
},
"properties_mag": {
"type": "number"
},
"properties_place": {
"type": [
"null",
"string"
]
},
"properties_time": {
"type": "integer"
},
"properties_updated": {
"type": "integer"
},
"properties_tz": {
"type": "null"
},
"properties_url": {
"type": "string"
},
"properties_detail": {
"type": "string"
},
"properties_felt": {
"type": [
"integer",
"null"
]
},
"properties_cdi": {
"type": [
"null",
"number"
]
},
"properties_mmi": {
"type": [
"null",
"number"
]
},
"properties_alert": {
"type": [
"null",
"string"
]
},
"properties_status": {
"type": "string"
},
"properties_tsunami": {
"type": "integer"
},
"properties_sig": {
"type": "integer"
},
"properties_net": {
"type": "string"
},
"properties_code": {
"type": "string"
},
"properties_ids": {
"type": "string"
},
"properties_sources": {
"type": "string"
},
"properties_types": {
"type": "string"
},
"properties_nst": {
"type": [
"integer",
"null"
]
},
"properties_dmin": {
"type": [
"null",
"number"
]
},
"properties_rms": {
"type": "number"
},
"properties_gap": {
"type": [
"null",
"number"
]
},
"properties_magType": {
"type": "string"
},
"properties_type": {
"type": "string"
},
"properties_title": {
"type": "string"
},
"geometry_type": {
"type": "string"
},
"geometry_coordinates": {
"type": "string"
},
"id": {
"type": "string"
}
},
"type": "object"
},
"stream": "us_earthquakes",
"metadata": [
{
"breadcrumb": [
"properties",
"type"
],
"metadata": {
"inclusion": "available",
"selected": true
}
},
{
"breadcrumb": [
"properties",
"properties_mag"
],
"metadata": {
"inclusion": "available",
"selected": true
}
},
{
"breadcrumb": [
"properties",
"properties_place"
],
"metadata": {
"inclusion": "available",
"selected": true
}
},
{
"breadcrumb": [
"properties",
"properties_time"
],
"metadata": {
"inclusion": "available",
"…pat_nadolny
12/09/2022, 1:30 AMsudeep_puvadi
12/09/2022, 3:31 PMsudeep_puvadi
12/09/2022, 3:32 PMsudeep_puvadi
12/09/2022, 5:47 PMsudeep_puvadi
12/09/2022, 5:47 PMsudeep_puvadi
12/09/2022, 5:47 PMsudeep_puvadi
12/09/2022, 5:48 PMpat_nadolny
12/09/2022, 5:50 PMmeltano config tap-rest-api-msdk test
. Do you have any environment configurations that you need to connect? It looks like the default behavior for config is to ignore default environments. If so, add the environment flag like the log suggestssudeep_puvadi
12/09/2022, 5:52 PMsudeep_puvadi
12/09/2022, 5:55 PMsudeep_puvadi
12/09/2022, 5:55 PMpat_nadolny
12/09/2022, 5:58 PMmeltano config tap-rest-api-msdk
to confirm your config looks as expected? Mine from the demo I linked above looks like this:
{
"api_url": "<https://earthquake.usgs.gov/fdsnws>",
"streams": [
{
"name": "us_earthquakes",
"params": {
"format": "geojson",
"starttime": "2022-12-07",
"endtime": "2022-12-08",
"minmagnitude": 1
},
"path": "/event/1/query",
"primary_keys": [
"id"
],
"records_path": "$.features[*]",
"num_inference_records": 200
}
]
}
sudeep_puvadi
12/09/2022, 6:01 PMsudeep_puvadi
12/09/2022, 6:01 PMsudeep_puvadi
12/09/2022, 6:01 PMpat_nadolny
12/09/2022, 6:39 PMsudeep_puvadi
12/09/2022, 6:46 PMsudeep_puvadi
12/09/2022, 6:46 PMpat_nadolny
12/09/2022, 6:49 PMschema
key from your streams config. By default it will try to infer the schema for you based on the API responsesudeep_puvadi
12/09/2022, 6:49 PMsudeep_puvadi
12/09/2022, 6:51 PMpat_nadolny
12/09/2022, 6:53 PMsudeep_puvadi
12/09/2022, 6:55 PMpat_nadolny
12/09/2022, 6:57 PMmeltano invoke tap-rest-api-msdk
? Also if sharing your postman request might be helpful (without secrets)sudeep_puvadi
12/09/2022, 6:57 PMsudeep_puvadi
12/09/2022, 6:59 PMsudeep_puvadi
12/09/2022, 7:01 PMpat_nadolny
12/09/2022, 7:06 PMsudeep_puvadi
12/09/2022, 7:08 PM{
"status": 401,
"title": "Unauthorized",
"detail": "This request requires HTTP authentication."
}
sudeep_puvadi
12/09/2022, 7:08 PMpat_nadolny
12/09/2022, 7:09 PMsudeep_puvadi
12/09/2022, 7:10 PMedgar_ramirez_mondragon
12/09/2022, 7:12 PMedgar_ramirez_mondragon
12/09/2022, 7:12 PMsudeep_puvadi
12/09/2022, 7:15 PMsudeep_puvadi
12/09/2022, 7:15 PMedgar_ramirez_mondragon
12/09/2022, 7:16 PMContent-Type
, for examplesudeep_puvadi
12/09/2022, 7:16 PMsudeep_puvadi
12/09/2022, 7:16 PMsudeep_puvadi
12/09/2022, 7:21 PMsudeep_puvadi
12/09/2022, 7:31 PMsudeep_puvadi
12/09/2022, 7:32 PMedgar_ramirez_mondragon
12/09/2022, 7:35 PMsudeep_puvadi
12/09/2022, 7:36 PMsudeep_puvadi
12/09/2022, 7:39 PMsudeep_puvadi
12/09/2022, 7:40 PMedgar_ramirez_mondragon
12/09/2022, 7:43 PM--location
means redirects are ok, no changes needed in the request in the SDK 👍
• Is the session cookie a hardcoded value in postman?sudeep_puvadi
12/09/2022, 7:44 PMedgar_ramirez_mondragon
12/09/2022, 7:48 PMSet-Cookie
header and so the next request has the right cookie.edgar_ramirez_mondragon
12/09/2022, 7:49 PMsudeep_puvadi
12/09/2022, 7:50 PMsudeep_puvadi
12/09/2022, 7:51 PMedgar_ramirez_mondragon
12/09/2022, 7:54 PMedgar_ramirez_mondragon
12/09/2022, 7:59 PMimport requests
YOUR_TOKEN = "..."
session = requests.Session()
session.get(
"<https://otm.com/logisticsRestApi/resources-int/v2/corporations>", # or the right URL
headers={
"Authorization": f"Bearer: {YOUR_TOKEN}"
},
)
can you try running that in Python >= 3.6?sudeep_puvadi
12/09/2022, 7:59 PMsudeep_puvadi
12/09/2022, 7:59 PMsudeep_puvadi
12/09/2022, 8:04 PMsudeeppuvadi@PC-5CD2317P11:~$ python3 ./test.py
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 366, in connect
self.sock = ssl_wrap_socket(
File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sudeeppuvadi/.local/lib/python3.8/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 400, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 702, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 366, in connect
self.sock = ssl_wrap_socket(
File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./test.py", line 6, in <module>
session.get(
File "/home/sudeeppuvadi/.local/lib/python3.8/site-packages/requests/sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "/home/sudeeppuvadi/.local/lib/python3.8/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/home/sudeeppuvadi/.local/lib/python3.8/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/home/sudeeppuvadi/.local/lib/python3.8/site-packages/requests/adapters.py", line 547, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
edgar_ramirez_mondragon
12/09/2022, 8:07 PMsudeep_puvadi
12/09/2022, 8:08 PMsudeep_puvadi
12/09/2022, 8:09 PMedgar_ramirez_mondragon
12/09/2022, 8:38 PMsudeep_puvadi
12/09/2022, 8:42 PMsudeep_puvadi
12/09/2022, 8:42 PM