Skip to main content

The OData Reader currently fails with the error “The version '4.01' is not valid.” when you try to retrieve data from an OData Version 4.01 Endpoint.

 

Full Log:

Creating reader for format: OData
Trying to find a PYTHON plugin for reader named `ODATA'
The workspace does not contain user Python. FME will attempt to use a Python 3.13+ interpreter
Using Python interpreter from `C:\Program Files\FME\fmepython313\python313.dll' with PYTHONHOME `C:\Program Files\FME\fmepython313'
Python version 3.13 loaded successfully
Loaded Python module `odata' from file `C:\Program Files\FME\python\fme-plugins-py313.zip\odata\__init__.pyc'
DEBUG: Configured logging for ODataReader
DEBUG: ODataCommon __init__()
DEBUG: Inspecting mapping file
DEBUG: Feature Geometry Priority: 'none'
DEBUG: Feature Type(s): 'ProductDescription,Product'
OData Reader: Performing client-side pagination with 1000 features per request
DEBUG: DEF line: ODATA_2_DEF ProductDescription odata_type odata_none FILTER_QUERY Language eq 'DE' ORDER_BY_QUERY EXPAND_QUERY fme_attribute_reading defined Product string ProductDescription string
DEBUG: Attributes: Product ProductDescription
DEBUG: Options: odata_type FILTER_QUERY ORDER_BY_QUERY EXPAND_QUERY fme_attribute_reading
DEBUG: DEF line: ODATA_2_DEF Product odata_type odata_none FILTER_QUERY ProductGroup eq 'ZS03' and IsMarkedForDeletion eq false ORDER_BY_QUERY EXPAND_QUERY fme_attribute_reading defined Product string
DEBUG: Attributes: Product
DEBUG: Options: odata_type FILTER_QUERY ORDER_BY_QUERY EXPAND_QUERY fme_attribute_reading
Retrieving connection 'SAP S4 Test'
Retrieving connection 'SAP S4 Test'
Retrieving web service 'HTTP Authentication'
ODATA reader: Creating bulk features from individual features
Using MultiWriter with keyword `PRIMARY_DEST' to output data (ID_ATTRIBUTE is `multi_writer_id')
Writer output will be ordered by value of multi_writer_id
Loaded module 'LogCount_func' from file 'C:\Program Files\FME\plugins\LogCount_func.dll'
FME API version of module 'LogCount_func' matches current internal version (4.0 20240722)
DEBUG: urllib3.connectionpool Starting new HTTPS connection (1): my123486.s4hana.cloud.sap:443
DEBUG: http.client send: b'GET /sap/opu/odata4/sap/api_product/srvd_a2x/sap/product/0002/ HTTP/1.1\r\nHost: my123486.s4hana.cloud.sap\r\nUser-Agent: FME/2025.7.52.25241 python-requests/2.32.3\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/xml,application/json\r\nConnection: keep-alive\r\nOData-MaxVersion: 4.0\r\nAuthorization: Basic XXX\r\n\r\n'
DEBUG: http.client reply: 'HTTP/1.1 200 OK\r\n'
DEBUG: http.client header: set-cookie: sap-usercontext=sap-client=100; path=/
DEBUG: http.client header: set-cookie: SAP_SESSIONID_Z5R_100=XXX%3d; path=/; secure; HttpOnly
DEBUG: http.client header: content-type: application/json;odata.metadata=minimal;charset=utf-8
DEBUG: http.client header: content-length: 488
DEBUG: http.client header: sap-authenticated: true
DEBUG: http.client header: odata-version: 4.0
DEBUG: http.client header: cache-control: max-age=0
DEBUG: http.client header: sap-server: true
DEBUG: http.client header: sap-perf-fesrec: 59482.000000
DEBUG: http.client header: content-encoding: gzip
DEBUG: http.client header: x-content-type-options: nosniff
DEBUG: http.client header: strict-transport-security: max-age=31536000; includeSubDomains
DEBUG: http.client header: x-xss-protection: 1; mode=block
DEBUG: http.client header: sap-passport-component: none
DEBUG: urllib3.connectionpool https://my123486.s4hana.cloud.sap:443 "GET /sap/opu/odata4/sap/api_product/srvd_a2x/sap/product/0002/ HTTP/1.1" 200 488
DEBUG: URL with appended params: https://my123486.s4hana.cloud.sap/sap/opu/odata4/sap/api_product/srvd_a2x/sap/product/0002/
DEBUG: http.client send: b'GET /sap/opu/odata4/sap/api_product/srvd_a2x/sap/product/0002/$metadata HTTP/1.1\r\nHost: my123486.s4hana.cloud.sap\r\nUser-Agent: FME/2025.7.52.25241 python-requests/2.32.3\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nOData-MaxVersion: 4.0\r\nCookie: sap-usercontext=sap-client=100; SAP_SESSIONID_Z5R_100=XXX%3d\r\nAuthorization: Basic XXX\r\n\r\n'
DEBUG: http.client reply: 'HTTP/1.1 400 Bad Request\r\n'
DEBUG: http.client header: content-type: application/json;odata.metadata=minimal;charset=utf-8
DEBUG: http.client header: content-length: 775
DEBUG: http.client header: sap-authenticated: true
DEBUG: http.client header: odata-version: 4.0
DEBUG: http.client header: etag: W/"20250720003254"
DEBUG: http.client header: cache-control: max-age=0
DEBUG: http.client header: content-language: en
DEBUG: http.client header: sap-server: true
DEBUG: http.client header: sap-perf-fesrec: 198967.000000
DEBUG: http.client header: x-content-type-options: nosniff
DEBUG: http.client header: strict-transport-security: max-age=31536000; includeSubDomains
DEBUG: http.client header: x-xss-protection: 1; mode=block
DEBUG: http.client header: sap-passport-component: none
DEBUG: urllib3.connectionpool https://my123486.s4hana.cloud.sap:443 "GET /sap/opu/odata4/sap/api_product/srvd_a2x/sap/product/0002/$metadata HTTP/1.1" 400 775
DEBUG: URL with appended params: https://my123486.s4hana.cloud.sap/sap/opu/odata4/sap/api_product/srvd_a2x/sap/product/0002/$metadata
OData Reader: Client error was received: '400'. The error message was: 'The version '4.01' is not valid.'
(D:\code\fme\source\engine\plugins\python\fme-odata\src\odata\ODataCommon.py:77) doRequest
(C:\Program Files\FME\python\requests\models.py:1024) raise_for_status
raise HTTPError(http_error_msg, response=self)
(D:\code\fme\source\engine\plugins\python\fme-odata\src\odata\ODataReader.py:534) read
(D:\code\fme\source\engine\plugins\python\fme-odata\src\odata\ODataReader.py:541) _readFeatureGenerator
(D:\code\fme\source\engine\plugins\python\fme-odata\src\odata\ODataReader.py:361) _fetchMetadataForSchema
(D:\code\fme\source\engine\plugins\python\fme-odata\src\odata\ODataCommon.py:129) doRequest
Python Exception <ODataReaderException>: FMEException: 929906: OData Reader: Client error was received: '400'. The error message was: 'The version '4.01' is not valid.'
An error has occurred. Check the logfile above for details
(D:\code\fme\source\engine\core\engine\readrimp.cpp:1102) class StatusInfo __cdecl STFReaderImp::getNextFeaturesFromReader(bool)
(D:\code\fme\source\engine\core\engine\readrimp.cpp:1034) class StatusInfo __cdecl STFReaderImp::getTaggedFeature(class STFFeature *&)
(D:\code\fme\source\engine\core\engine\readrimp.cpp:1116) class StatusInfo __cdecl STFReaderImp::getNextFeaturesFromReader(bool)
(D:\code\fme\source\engine\core\engine\readrimp.cpp:1034) class StatusInfo __cdecl STFReaderImp::getTaggedFeature(class STFFeature *&)
(D:\code\fme\source\engine\core\kernel\simptran.cpp:664) class StatusInfo __cdecl STFSimpleTranslator::convert(void)
(D:\code\fme\source\engine\core\engine\stftrans.cpp:128) class StatusInfo __cdecl STFTranslator::translate(void)
Translation FAILED with 2 error(s) and 59 warning(s) (0 feature(s) output)
FME Session Duration: 1.5 seconds. (CPU: 0.6s user, 0.4s system)
END - ProcessID: 27860, peak process memory usage: 90180 kB, current process memory usage: 72884 kB
ERROR : An error has occurred. Check the logfile above for details
ERROR : (D:\code\fme\source\engine\core\engine\readrimp.cpp:1102) class StatusInfo __cdecl STFReaderImp::getNextFeaturesFromReader(bool)
ERROR : (D:\code\fme\source\engine\core\engine\readrimp.cpp:1034) class StatusInfo __cdecl STFReaderImp::getTaggedFeature(class STFFeature *&)
ERROR : (D:\code\fme\source\engine\core\engine\readrimp.cpp:1116) class StatusInfo __cdecl STFReaderImp::getNextFeaturesFromReader(bool)
ERROR : (D:\code\fme\source\engine\core\engine\readrimp.cpp:1034) class StatusInfo __cdecl STFReaderImp::getTaggedFeature(class STFFeature *&)
ERROR : (D:\code\fme\source\engine\core\kernel\simptran.cpp:664) class StatusInfo __cdecl STFSimpleTranslator::convert(void)
ERROR : (D:\code\fme\source\engine\core\engine\stftrans.cpp:128) class StatusInfo __cdecl STFTranslator::translate(void)
ERROR : (D:\code\fme\source\engine\core\kernel\fmetran.cpp:934) class StatusInfo __cdecl FMETranslator::translate(class stk::ex::UStringArray<0>,bool &,bool,const class std::function<bool __cdecl(class ObsoleteString &)> &,bool)

 

 

It would be great, if the OData Reader would add support for OData 4.01 in the future.

NewOpen