wallabag / wallabag

wallabag is a self hostable application for saving web pages: Save and classify articles. Read them later. Freely.
https://wallabag.org
MIT License
10.19k stars 759 forks source link

Can't import over the web interface with PHP 8.1 #5631

Closed dertuxmalwieder closed 1 year ago

dertuxmalwieder commented 2 years ago

Environment

My app/config/parameters.yml is: ``` parameters: database_driver: pdo_mysql database_host: 127.0.0.1 database_port: null database_name: REDACTED_wallabag database_user: REDACTED database_password: REDACTED database_path: null database_table_prefix: wallabag_ database_socket: null database_charset: utf8mb4 domain_name: REDACTED server_name: REDACTED mailer_transport: smtp mailer_user: wallabag mailer_password: REDACTED mailer_host: 127.0.0.1 mailer_port: 587 mailer_encryption: null mailer_auth_mode: null locale: de secret: REDACTED twofactor_auth: false twofactor_sender: no-reply@wallabag.org fosuser_registration: false fosuser_confirmation: true fos_oauth_server_access_token_lifetime: 3600 fos_oauth_server_refresh_token_lifetime: 1209600 from_email: no-reply@wallabag.org rss_limit: 200 rabbitmq_host: localhost rabbitmq_port: 5672 rabbitmq_user: guest rabbitmq_password: guest rabbitmq_prefetch_count: 10 redis_scheme: tcp redis_host: localhost redis_port: 6379 redis_path: null redis_password: null sentry_dsn: null ```

What steps will reproduce the bug?

  1. Create a CSV file from Instapaper.
  2. Try to import that CSV file.

Expected behavior:

Import works.

Actual outcome:

Symfony throws an error:

This form should not contain extra fields.

This happens with both a modified Vivaldi and a clean Firefox installation. Importing per bin/console works, so the file is not the issue.

Kdecherf commented 2 years ago

Hello @dertuxmalwieder, would you be able to provide a sample csv file in order to test on our side?

dertuxmalwieder commented 2 years ago

Sure. Here's a minimal example with only 3 entries (mine has 379):

URL,Title,Selection,Folder,Timestamp
https://www.weltfein.de/open-whisky-hannover.html,"Das Whisky, Rum und Gin Event in Hannover im Oktober 2020",,Unread,1645219247
https://hermitage-cafe-bar.business.site,Hermitage Café Bistro Bar,,Unread,1644791560
http://www.consulproject.nl/de/,CONSUL,,Stadtrat,1644527309
Kdecherf commented 2 years ago

Thanks, will try to take time this evening to investigate

Kdecherf commented 2 years ago

I'm unable to reproduce the error with the provided example: 2022-02-21-214809_385x351

dertuxmalwieder commented 2 years ago

Interesting. Why does it work for you, but it does not in any of my browsers?

I have tried to install the same Wallabag version on a different server with a different OS and a different httpd and now it says that I should "check the CSV file". 😐

Kdecherf commented 2 years ago

Are you reproducing these errors with the example csv you gave (just to be sure)?

dertuxmalwieder commented 2 years ago

Yes, I am.

Kdecherf commented 2 years ago

Ok I am able to reproduce with PHP 8.1, it does not occur on PHP 8.0 and 7.4.

Kdecherf commented 2 years ago

It looks like there's an issue between FileBag and PHP 8.1. A fix has been committed in Symfony 4.4+, see https://github.com/symfony/symfony/pull/42112

I don't see an easy fix right now as we're blocked on sf 3.4, thoughts @wallabag/core?

@dertuxmalwieder the best workaround would be to run wallabag on PHP 8.0.

dertuxmalwieder commented 2 years ago

Thank you, good to know. One of my servers runs 8.0, but I seriously consider backporting the fix locally instead...

j0k3r commented 2 years ago

@dertuxmalwieder That might be the best solution to backport that fix.

@Kdecherf I checked the Symfony\Component\HttpFoundation\Request (where the FileBag is used) and I think it's barely impossible to fix it on our own... Or we need to fork the 3.4 version to manually apply the fix 😬

Kdecherf commented 2 years ago

@j0k3r I think this issue impacts all forms having an upload field (so all imports, at least)

blacklight commented 2 years ago

Has the fix been shipped? I'm also on PHP 8.1, and upload forms don't work.

j0k3r commented 2 years ago

2.6.0 isn't released yet otherwise that issue would be closed.

j0k3r commented 1 year ago

2.6.0 has been updated to Symfony 4, the bug should now be fixed, see https://github.com/wallabag/wallabag/issues/5631#issuecomment-1047262694

konradx commented 1 year ago

I've just installed wallabag on fresh debian 12 with php 8.2.7. Importing json exported from wallabag.it gives the same error. Not sure if it's the same bug through. I've run composer update just in case but the error persists.