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

Some dummy content CSV files cause errors #272

Open
thierrydallacroce opened this issue Dec 9, 2019 · 1 comment
Open

Some dummy content CSV files cause errors #272

thierrydallacroce opened this issue Dec 9, 2019 · 1 comment

Comments

@thierrydallacroce
Copy link
Contributor

Steps to reproduce:

  1. dktl install (from master)
  2. dktl drush dkan-dummy-content:create
  3. dktl drush cron
  4. dktl drush dkan-datastore:list
  5. dktl drush dkan-harvest:list

Will output errors such as:

[error]  Import for 144f86b3-9828-556a-be7c-9331b9843dc3 returned an error: Machine did not halt
[error]  Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '53' for key 'PRIMARY': INSERT INTO {jobstore_dkan_datastore_importer} (ref_uuid, job_data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array
(
  [:db_insert_placeholder_0] => 53
  [:db_insert_placeholder_1] => 
)
in Drupal\Core\Database\Connection->handleQueryException() (line 689 of /Users/thierry.dallacroce/Code/dkan/docroot/core/lib/Drupal/Core/Database/Connection.php).
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '53' for key 'PRIMARY': INSERT INTO {jobstore_dkan_datastore_importer} (ref_uuid, job_data) VALUES (:db  
_insert_placeholder_0, :db_insert_placeholder_1); Array                                                                                                                        
(
  [:db_insert_placeholder_0] => 53                                                                                                                                           
  [:db_insert_placeholder_1] => {"parser":{"@type":"object","@class":"CsvParser\\Parser\\Csv","data":{"delimiter":",","quote":"\"","escape":"\\","recordEnd":["\n","\r"],"r  
  ecords":[],"fields":[],"field":"","machine":{"currentStates":["s_new_field"],"halted":false,"machines":[]}}},"identifier":"53","result":null,"timeLimit":9223372036854775807}  
)

I diagnosed the issues to the following dummy content CSV files:

  1. docroot/profiles/contrib/dkan2/modules/custom/dkan_dummy_content/files/district_centerpoints_0.csv has right-to-left characters
  2. docroot/profiles/contrib/dkan2/modules/custom/dkan_dummy_content/files/data_0.csv has Windows line endings
@thierrydallacroce
Copy link
Contributor Author

This findings might reveal bugs or limitations within GetDKAN/csv-parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant