Question

Issue with FeatureReader to Dynamic JSON Writer


Dear Community,

 

I have set up a similar Workbench to this tutorial:

https://community.safe.com/s/article/extracting-data-within-a-clipping-polygon

 

Except I am fanning out a JSON files for each feature_type. This seems to work in FME Desktop, however when uploaded to the Server I get the following error when using Data Streaming:

 

1762023-3-25 15:54:00 | Cannot define schema for 'EXAMPLE_DATA' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration
1772023-3-25 15:54:00 | FME API version of module 'JSON' matches current internal version (3.8 20210302)
1782023-3-25 15:54:00 | Writer `JSON_1' of type `JSON' using group definition keyword `JSON_1_DEF'
1792023-3-25 15:54:00 | FME API version of module 'JSON' matches current internal version (3.8 20210302)
1802023-3-25 15:54:00 | Opening the JSON writer with destination dataset 'D:\ProgramData\Safe Software\FME Server\resources\system\temp\engineresults\FME_785A5842_1679756037809_7044\JSON_1\output\EXAMPLE_DATA.json'
 1812023-3-25 15:54:00 | FME Configuration: Destination coordinate system set to input coordinate system `CH1903Plus_1.LV95/01'
1822023-3-25 15:54:00 | JSON writer: Unknown feature type 'EXAMPLE_DATA' passed to the JSON writer

 

 

Anybody any wiser? Could it be caused by fanning out my dataset with .json added on?


3 replies

Userlevel 4
Badge +26

Is it just the data steaming service or is the issue there with the Job Submitter as well?

 

The ERROR is coming because FME is trying to create a file but before it does it needs to know the schema. Either a Data Feature is getting to the writer before a schema feature or there is a mismatch somewhere between the feature type name (EXAMPLE_DATA) in the Data Feature(s) and what is defined in the Schema Feature(s).

 

The writer will look at the feature type name of the data feature (in your case EXAMPLE_DATA) and then take a look at the incoming schema feature(s) to determine how to build the schema. If it can't find the schema it will fail.

 

If you're confident that your schema features are getting to the writer first and that their names match then its possible it could be because of the fanout. You can test the feature order by placing a logger just before the writer and looking at the order of the features in the logfile.

 

 

Hi Matt,

 

I've troubleshooted following your instructions including putting in a logger, decelerating the features being read and also removing the fanout function.

 

Both FME Desktop and FME Server log a schema attribute first, followed by the relevant data features. Both get to the point where JSON is checked - this is where FME Server fails. The only difference is my JSON on FME Desktop is (3.8 20200115)

 

FME Server Example

810	2023-4-10 15:36:57 | MULTI_WRITER: multi_writer_id `EXAMPLE.json': Started outputting features
811 2023-4-10 15:36:57 | MULTI_WRITER: Output will be zipped
812 2023-4-10 15:36:57 | Creating writer for format: JSON (JavaScript Object Notation)
813 2023-4-10 15:36:57 | Trying to find a DYNAMIC plugin for writer named `JSON'
814 2023-4-10 15:36:57 | FME API version of module 'JSON' matches current internal version (3.8 20210302)
815 2023-4-10 15:36:57 | FME Configuration: No destination coordinate system set
816 2023-4-10 15:36:57 | Cannot define schema for '' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration

 

FME Desktop:

MULTI_WRITER: multi_writer_id `EXAMPLE.json': Started outputting features
MULTI_WRITER: Output will be zipped
Creating writer for format: JSON (JavaScript Object Notation)
Trying to find a DYNAMIC plugin for writer named `JSON'
FME API version of module 'JSON' matches current internal version (3.8 20200115)
FME Configuration: No destination coordinate system set
FME API version of module 'JSON' matches current internal version (3.8 20200115)
Writer `JSON_1' of type `JSON' using group definition keyword `JSON_1_DEF'
FME API version of module 'JSON' matches current internal version (3.8 20200115)
Opening the JSON writer with destination dataset 'C:\Temp\FME_TEMP\wbrun_1681129603863_5228\fmetmp_1681133925630_5228\_auto_zip_dataset_1681133929325_340\EXAMPLE.json'

Would be happy for any further advice - is it the JSON version on the server?

 

Cheers

Userlevel 4
Badge +26

Hi Matt,

 

I've troubleshooted following your instructions including putting in a logger, decelerating the features being read and also removing the fanout function.

 

Both FME Desktop and FME Server log a schema attribute first, followed by the relevant data features. Both get to the point where JSON is checked - this is where FME Server fails. The only difference is my JSON on FME Desktop is (3.8 20200115)

 

FME Server Example

810	2023-4-10 15:36:57 | MULTI_WRITER: multi_writer_id `EXAMPLE.json': Started outputting features
811 2023-4-10 15:36:57 | MULTI_WRITER: Output will be zipped
812 2023-4-10 15:36:57 | Creating writer for format: JSON (JavaScript Object Notation)
813 2023-4-10 15:36:57 | Trying to find a DYNAMIC plugin for writer named `JSON'
814 2023-4-10 15:36:57 | FME API version of module 'JSON' matches current internal version (3.8 20210302)
815 2023-4-10 15:36:57 | FME Configuration: No destination coordinate system set
816 2023-4-10 15:36:57 | Cannot define schema for '' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration

 

FME Desktop:

MULTI_WRITER: multi_writer_id `EXAMPLE.json': Started outputting features
MULTI_WRITER: Output will be zipped
Creating writer for format: JSON (JavaScript Object Notation)
Trying to find a DYNAMIC plugin for writer named `JSON'
FME API version of module 'JSON' matches current internal version (3.8 20200115)
FME Configuration: No destination coordinate system set
FME API version of module 'JSON' matches current internal version (3.8 20200115)
Writer `JSON_1' of type `JSON' using group definition keyword `JSON_1_DEF'
FME API version of module 'JSON' matches current internal version (3.8 20200115)
Opening the JSON writer with destination dataset 'C:\Temp\FME_TEMP\wbrun_1681129603863_5228\fmetmp_1681133925630_5228\_auto_zip_dataset_1681133929325_340\EXAMPLE.json'

Would be happy for any further advice - is it the JSON version on the server?

 

Cheers

No, the version here is just indicating a version difference between FME Server and FME Desktop. I suppose that if the version is too different that could be part of the issue I guess. Make sure your FME Desktop and FME Server versions match:

 

The line in the log which is standing out to me is:

Cannot define schema for '' as the feature does not contain schema information

This is different to the old log where the feature type name was EXAMPLE_DATA. This suggests that for whatever reason there is a missing fme_feature_type attribute? 

 

Reply