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

badly encoded character in article name causes sync_ftp_files to abort #23

Open
JuliusR opened this issue Nov 5, 2021 · 2 comments
Open
Labels

Comments

@JuliusR
Copy link

JuliusR commented Nov 5, 2021

I have experienced a BNN file with a special character in the name of one article. The "bad" article causes the following error:

Mysql2::Error: Incorrect string value: '\xE2\x95\x9Aoro...'
for column `sharedlists`.`articles`.`name` at row 1:
INSERT INTO `articles` (
  `category`, 
  `created_on`, 
  `deposit`, 
  `manufacturer`, 
  `name`, 
  `note`, 
  `number`, 
  `origin`, 
  `price`, 
  `scale_price`, 
  `scale_quantity`, 
  `supplier_id`, 
  `tax`, 
  `unit`, 
  `unit_quantity`, 
  `updated_on`
) VALUES ([...], 'Pomi d╚oro [...]', [...])

The character looks wrong, but I also see that character when opening the original BNN file using CP 850 encoding. I believe it is supposed to read ' or ` or .

The problem is that this one bad file causes the whole sync_ftp_files job to abort.

@JuliusR JuliusR added the bug label Nov 5, 2021
@1resu
Copy link

1resu commented Nov 5, 2021

The cause of problem at the foodcoops.net deployment was a non-utf8 collation of sharedlists' database. After converting the articles table to utf8 (ALTER TABLE articles CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;) the sync job runs without problems.

I'm not sure if this is a problem thats goes beyond our deployment as the default database collation is already utf8.

@JuliusR
Copy link
Author

JuliusR commented Nov 9, 2021

I'm not sure if this is a problem thats goes beyond our deployment as the default database collation is already utf8.

I can reproduce the problem locally, so it is not restricted to the foodcoops.net deployment. It is good to have a manual fix. 👍

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

No branches or pull requests

2 participants