Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when creating Data Package using Wizard in CSIS #52

Closed
maesbri opened this issue Feb 28, 2019 · 15 comments
Closed

Error when creating Data Package using Wizard in CSIS #52

maesbri opened this issue Feb 28, 2019 · 15 comments
Assignees
Labels
BB: Data Dashboard Data Dashboard Building Block bug Something isn't working SHOWSTOPPER Feature or bug, that, if not addressed, renders the CSIS essentially useless

Comments

@maesbri
Copy link

maesbri commented Feb 28, 2019

I have started creating the Naples data package. You can check it here: https://csis.myclimateservice.eu/node/148

I have just managed to create the top level properties of the data package, but I have encountered problems to save the resources. I started adding the "agricultural-areas" resource (an easy one that is also in the json file in the naples example) and after filling in all properties I get this error:

image

I have tried to complete only the mandatory fields for the resource but I am still getting the error.

@fgeyer16 @patrickkaleta @p-a-s-c-a-l , Any idea of why is it happening?
Btw, I also noticed that in the EU-GL Context section of the resource there is still stuff to be fixed (mainly concerning the taxonomies filtering, etc.).

I cannot progress until this major error is fixed.

@maesbri maesbri changed the title Data Package Wizard in CSIS Error when creating Data Package using Wizard in CSIS Feb 28, 2019
@maesbri
Copy link
Author

maesbri commented Feb 28, 2019

Btw, without resource, but adding the temporal_extent at data package level also generates the same error

@p-a-s-c-a-l p-a-s-c-a-l transferred this issue from clarity-h2020/csis Feb 28, 2019
@p-a-s-c-a-l p-a-s-c-a-l added the bug Something isn't working label Feb 28, 2019
@p-a-s-c-a-l p-a-s-c-a-l added this to the D1.3 CLARITY CSIS v1 milestone Feb 28, 2019
@p-a-s-c-a-l p-a-s-c-a-l added the SHOWSTOPPER Feature or bug, that, if not addressed, renders the CSIS essentially useless label Feb 28, 2019
@p-a-s-c-a-l
Copy link
Member

p-a-s-c-a-l commented Feb 28, 2019

Here is the postgres logfile: csis-postgis.log (get it with docker logs csis-postgis)

It seems that a taxonomy / group relationship is broken. This is probably also the cause of #50 and #51

2019-02-28 10:22:10.640 UTC [246] ERROR:  invalid input syntax for integer: "structure" at character 1652
2019-02-28 10:22:10.640 UTC [246] STATEMENT:  SELECT taxonomy_term__field_study_step.field_study_step_value AS taxonomy_term__field_study_step_field_study_step_value, taxonomy_term_field_data.tid AS tid, field_field_eu_gl_methodology_taxonomy_term_field_data.nid AS field_field_eu_gl_methodology_taxonomy_term_field_data_nid, group_content_field_data_node_field_data.id AS group_content_field_data_node_field_data_id, groups_field_data_group_content_field_data.id AS groups_field_data_group_content_field_data_id
	FROM
	taxonomy_term_field_data taxonomy_term_field_data
	LEFT JOIN node__field_field_eu_gl_methodology node__field_field_eu_gl_methodology ON taxonomy_term_field_data.tid = node__field_field_eu_gl_methodology.field_field_eu_gl_methodology_target_id AND node__field_field_eu_gl_methodology.deleted = '0'
	LEFT JOIN node_field_data field_field_eu_gl_methodology_taxonomy_term_field_data ON node__field_field_eu_gl_methodology.entity_id = field_field_eu_gl_methodology_taxonomy_term_field_data.nid
	LEFT JOIN group_content_field_data group_content_field_data_node_field_data ON field_field_eu_gl_methodology_taxonomy_term_field_data.nid = group_content_field_data_node_field_data.entity_id AND group_content_field_data_node_field_data.type = 'study-group_node-gl_step'
	LEFT JOIN groups_field_data groups_field_data_group_content_field_data ON group_content_field_data_node_field_data.gid = groups_field_data_group_content_field_data.id
	LEFT JOIN taxonomy_term__field_study_step taxonomy_term__field_study_step ON taxonomy_term_field_data.tid = taxonomy_term__field_study_step.entity_id AND taxonomy_term__field_study_step.deleted = '0'
	WHERE ((group_content_field_data_node_field_data.gid = 'structure')) AND ((taxonomy_term_field_data.status = '1') AND (taxonomy_term_field_data.vid IN ('eu_gl')))
	ORDER BY taxonomy_term__field_study_step_field_study_step_value ASC NULLS FIRST
	LIMIT 20 OFFSET 0

@p-a-s-c-a-l
Copy link
Member

@maesbri BTW, you can use Chrome DEV Tools to inspect the HTTP request/responses.

@p-a-s-c-a-l
Copy link
Member

From docker-csis logs:

``
[Thu Feb 28 11:25:58.493149 2019] [php7:notice] [pid 19] [client 172.19.0.11:38500] Uncaught PHP Exception Drupal\Core\Entity\EntityStorageException: "SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "title" violates not-null constraint\nDETAIL: Failing row contains (161, 210, analysis_context, en, 1, null, 21, 1551353157, 1551353157, 0, 0, 1, 1).: INSERT INTO node_field_data (nid, vid, type, langcode, status, title, uid, created, changed, promote, sticky, default_langcode, revision_translation_affected) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array\n(\n)\n" at /app/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php line 783, referer: https://csis.myclimateservice.eu/entity-browser/modal/data_resources?uuid=d8785345d22d34f877adec25492ad9c8dacdb312&original_path=/node/148/edit

``

@patrickkaleta
Copy link
Contributor

@p-a-s-c-a-l thanks for the log file, I will check in my local instance, whether this could be somehow related to #50, since no terms were accidentally removed in my local instance.

Also according to the log file, it seems like some title fields are left NULL, even though they shouldn't be. I will check this also in my local instance and make some adjustments to the form modes.

@maesbri
Copy link
Author

maesbri commented Feb 28, 2019

The EU-GL property refers to this in the Data Package wizard:

image

The first element (EU-GL) should not appear, only each of the steps should be selectable.

@fgeyer16 said he would fix all those taxomony and node-related fields, but I think it has not been addressed.

I guess the same issue might happen with hazards (only the hazard types should appear by filtering the taxonomy):

image

Elements at risk:
image

Vulnerability classes and damage classes don't have yet a taxonomy :
image

@patrickkaleta
Copy link
Contributor

I believe the problem is with the "Automatic Label" function, which should automatically fill in the title field, when a content entity is created. Currently, the title field should be filled dynamically with the nodeID of the new content entity, but that doesn't always seem to work, so I will for now use fixed title values.

@maesbri I will let you know once I'm done and then you can continue with creating the data package.

@maesbri
Copy link
Author

maesbri commented Feb 28, 2019

Hmm, not sure if this is right ... the title field content is dependent on each resource and it should be filled in by the user

@patrickkaleta
Copy link
Contributor

patrickkaleta commented Feb 28, 2019

Hmm, not sure if this is right ... the title field content is dependent on each resource and it should be filled in by the user

I was talking about the default title field each content type in Drupal must have. For some content entities I found manually added fields called "name", which is probably what you are referring to.

However, I also found in one instance (for dp_resource) a manually added field called "title" which was set to be shown on the form, while the default (and mandatory) Drupal title field was hidden and supposed to be automatically field with the nodeID. Please check the structure with @fgeyer16 again, because this is very confusing right now.

However, I was now able to create a dummy dp_resource in CSIS now without getting an error, so I believe it should work now. Please try to add the data package and let me know if it is working now or not.

@patrickkaleta
Copy link
Contributor

@fgeyer16 and @maesbri
I also just now created a test data package and added the existing resource I created a couple of minutes ago and it also worked.

Again, I noticed that for the dp_data_package there is a manually added field called "title", which gets displayed in the form, while the default title field is hidden and automatically filled... also I realized, that you're not trying to fill the default title-field with the nodeID, but with the content of the field called "ID" (I assumed that by mistake in my previous comment).

So again, @fgeyer16 and @maesbri please explain, why this is being done like that? Couldn't we instead do this:

  1. use the default Drupal title field, change its label to say "ID" (so that the user thinks he's entering the data for the ID field) and make it visible on the form
  2. remove the manually added field "ID", since it would be obsolete
  3. remove the "Automatic label" option, since it would be obsolete
  4. change the label of the manually added "title" field to prevent any future confusions with the default "title" field

@patrickkaleta
Copy link
Contributor

In conclusion:
I changed the "Automatic label" option for the following content types, because it was either completely missing (which then will always lead to errors if the default title field is hidden in the form) or apparently not working correctly (didn't have the time to properly check this for every content type):

On this page we can add individual content entities (so for example just one dp_grid_info). I suggest that from now on whenever a new entity type is created or an existing one updated/changed, that we try to create one dummy entity of that type to see whether it's working or not.

@maesbri
Copy link
Author

maesbri commented Feb 28, 2019

ok, thanks.
I am not an expert in this stuff, I had some support from @fgeyer16 when I created the wizard.
I'll have a look at what you are mentioning.

btw, I tried to add a resource (maybe at the same time when you where testing this other stuff) and although I managed to save it, there were also a bunch of messy errors (e.g., sections from the resources appearing at the data package level when saving, etc.). I'll check if these changes solved it.

@p-a-s-c-a-l
Copy link
Member

I wanted to check whether there are some VA resources in the current data package, but instead of the title, the identifier (URI) of the resource is shown in the editor but also in the views:

grafik

@patrickkaleta
Copy link
Contributor

I changed the display to now show the title of the resource instead of the identifier.

@p-a-s-c-a-l
Copy link
Member

done

@p-a-s-c-a-l p-a-s-c-a-l added the BB: Data Dashboard Data Dashboard Building Block label Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BB: Data Dashboard Data Dashboard Building Block bug Something isn't working SHOWSTOPPER Feature or bug, that, if not addressed, renders the CSIS essentially useless
Projects
None yet
Development

No branches or pull requests

5 participants