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

Import from wallabag v1 data fails with csrf error and 'too large file' error #1764

Closed
inhji opened this issue Mar 8, 2016 · 8 comments
Closed
Labels
Milestone

Comments

@inhji
Copy link

inhji commented Mar 8, 2016

Issue details

When trying to upload a rather big export file (about 21MB) from wallabag v1.9.1, the import fails with the following errors:

The CSRF token is invalid. Please try to resubmit the form.
The uploaded file was too large. Please try to upload a smaller file.

I have raised the upload limits for nginx and php like this article explains: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/

Environment

  • wallabag version (or git revision) that exhibits the issue: version 2-beta1
  • How did you install wallabag? Via composer create-project or by downloading the package? via composer
  • Last wallabag version that did not exhibit the issue (if applicable):
  • php version: 5.5.9-1ubuntu4.14
  • OS: Ubuntu 14.04
  • type of hosting (shared or dedicated): dedicated
  • which storage system you choose at install (SQLite, MySQL/MariaDB or PostgreSQL): MYSQL

Steps to reproduce/test case

  • Install wallabag through composer
  • set a mysql database in the config prompt
  • start the production server with: php bin/console server:run --env=prod
  • login and go to import
  • upload the export.json file
  • the upload ends/fails and shows the error shown above
@nicosomb nicosomb added the Bug label Mar 16, 2016
@nicosomb nicosomb added this to the 2.0.0 milestone Mar 16, 2016
@nicosomb nicosomb modified the milestones: 2.0.0, 2.0.1 Apr 3, 2016
@NerosTie
Copy link

NerosTie commented Apr 4, 2016

Same issue here.

Until this bug is fixed, is there a trick we can use?

@nicosomb
Copy link
Member

nicosomb commented Apr 5, 2016

We developed a tool to import file via CLI.

Can you try this command please?

bin/console wallabag:import-v1 1 ~/Downloads/wallabag-export-1-2016-04-05.json

(I assume that you want to import data to your first created user, who has id 1)

FYI, I just launched this command, and it's very fast:

bin/console wallabag:import-v1 1 ~/Downloads/wallabag-export-1-2016-04-05.json
Start : 05-04-2016 11:36:07 ---
403 imported
0 already saved
End : 05-04-2016 11:36:09 ---

I forgot this command in fact ... Currently writing documentation about it.

@ddeimeke
Copy link
Contributor

ddeimeke commented Apr 5, 2016

I get an error:

15:33:13 [root@lenim:~] # cd /srv/www/wallabag.deimeke.net
15:33:22 [root@lenim:/srv/www/wallabag.deimeke.net] # bin/console wallabag:import-v1 1 /var/www/html/oc/data/dirk/files/wallabag-export-1-2016-04-05.json
PHP Fatal error:  Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /srv/www/wallabag.deimeke.net/app/AppKernel.php on line 45

@nicosomb
Copy link
Member

nicosomb commented Apr 5, 2016

Because you are in production environment, you need to run this command:

bin/console wallabag:import-v1 1 /var/www/html/oc/data/dirk/files/wallabag-export-1-2016-04-05.json --env=prod

@NerosTie
Copy link

NerosTie commented Apr 5, 2016

It works, thanks!

@4oo4
Copy link

4oo4 commented May 11, 2016

I was having this problem too and the console import seemed to work better, but now I keep running into this:

 [Doctrine\DBAL\Exception\DriverException]                                                                                                                              
  An exception occurred while executing 'INSERT INTO `wallabag_entry` (title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, readin  
  g_time, domain_name, preview_picture, is_public, user_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["The Attack That Broke the Dark Web\u2014an  
  d How Tor Plans to Fix It", "http:\/\/fusion.net\/story\/238742\/tor-carnegie-mellon-attack\/", 1, "0", "\n\t\t<p>Law enforcement has been complaining for years abou  
  t the Web \u201cgoing dark,\u201d saying that encryption and privacy tools are frustrating their ability to track criminals online.

---Snip Article Contents---

  SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x94\x93\xF0\x9F...' for column 'content' at row 1
 [Doctrine\DBAL\Driver\PDOException]
  SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x94\x93\xF0\x9F...' for column 'content' at row [PDOException]
  SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x94\x93\xF0\x9F...' for column 'content' at row 1

I had another article cause it to error out like that, I deleted the article in question did the v1 export, and did another clean import in the console, but still got the same message. I tried it with --ansi and --no-ansi, but still the same result.

Is there something I'm doing wrong? The only other thing I can think of doing is keep deleting the articles it throws up, but I'd rather try and save them in the migration :)

@j0k3r
Copy link
Member

j0k3r commented May 11, 2016

Could you open a separate issue with the json file you are trying to import? So we'll be able to reproduce the bug on our side.
Thanks

@4oo4
Copy link

4oo4 commented May 11, 2016

Will do, thanks!

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

6 participants