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

Uncaught PHP Exception InvalidArgumentException: "Unable to parse URI: //:0" blocks Android sync #6186

Open
shtrom opened this issue Dec 25, 2022 · 2 comments
Labels

Comments

@shtrom
Copy link
Contributor

shtrom commented Dec 25, 2022

Environment

My app/config/parameters.yml is:
# This file is a "template" of what your parameters.yml file should look like
parameters:
  # Uncomment these settings or manually update your parameters.yml
  # to use docker-compose
  #
  # database_driver: %env.database_driver%
  # database_host: %env.database_host%
  # database_port: %env.database_port%
  # database_name: %env.database_name%
  # database_user: %env.database_user%
  # database_password: %env.database_password%

  database_driver: pdo_mysql
  database_driver_class: ~
  database_host: null
  database_port: null
  database_name: wallabag
  database_user: wallabag
  database_password: XXX

  database_path: null
  database_table_prefix: wallabag_
  database_socket: "/var/run/mysql/mysql.sock"
  # with PostgreSQL and SQLite, you must set "utf8"
  # database_charset: utf8
  database_charset: utf8mb4

  domain_name: https://wallabag.example.net
  server_name: "Wall-a-bag"

  mailer_transport:  smtp
  mailer_user:       ~
  mailer_password:   ~
  mailer_host:       127.0.0.1
  mailer_port:       false
  mailer_encryption: ~
  mailer_auth_mode:  ~

  locale: en

  # A secret key that's used to generate certain security-related tokens
  secret: XXX

  # two factor stuff
  twofactor_auth: true
  twofactor_sender: wallabag+2fa@example.net

  # fosuser stuff
  fosuser_registration: true
  fosuser_confirmation: true

  # how long the access token should live in seconds for the API
  fos_oauth_server_access_token_lifetime: 3600
  # how long the refresh token should life in seconds for the API
  fos_oauth_server_refresh_token_lifetime: 1209600

  from_email: wallabag@example.net

  rss_limit: 50

  # RabbitMQ processing
  rabbitmq_host: localhost
  rabbitmq_port: 5672
  rabbitmq_user: guest
  rabbitmq_password: guest
  rabbitmq_prefetch_count: 10

  # Redis processing
  redis_scheme: tcp
  redis_host: localhost
  redis_port: 6379
  redis_path: null
  redis_password: null


  # sentry logging
  sentry_dsn: ~
  # sites credentials
  sites_credentials:
    - example.com: {XXX}

What steps will reproduce the bug?

When trying to sync https://www.linkedin.com/pulse/uncertain-futures-using-chatgpt-generate-risk-fair-inputs-whitsitt/ from the Android app, or reload it in the web UI, the following error shows in the logs. This leads to a 500 page in the web UI, and prevents the Android app from syncing in either direction.

[2022-12-25 12:53:00] app.DEBUG: DownloadImages: working on image: //:0 [] []
[2022-12-25 12:53:00] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "Unable to parse URI: //:0" at /srv/www/wallabag/vendor/guzzlehttp/psr7/src/Uri.php line 72 {"exception":"[object] (InvalidArgumentException(code: 0): Unable to parse URI: //:0 at /srv/www/wallabag/vendor/guzzlehttp/psr7/src/Uri.php:72)"} []

The offending string is indeed present in the original HTML of the page, as the src of some imgs, e.g.,

I guess this Exception should be caught, and failed gracefully on, rather than let it bubble up.

@shtrom
Copy link
Contributor Author

shtrom commented Dec 25, 2022

SQL workaround in the meantime:

update  wallabag_entry  set content=replace(content, '//:0', 'file:///dev/null') where id=8677  ;

@j0k3r j0k3r added the Bug label Jan 2, 2023
@shtrom
Copy link
Contributor Author

shtrom commented Jan 13, 2023

Another similar issue, on the same article, due to another unsupported image URI, also leading to a 500.

[2023-01-13 09:15:37] httplug.ERROR: Error: Unsupported scheme in "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==". when sending request: GET data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== 1.1 {"exception":"[object] (Http\\Client\\Exception\\RequestException(code: 0): Unsupported scheme in \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\". at /var/www/wallabag/vendor/symfony/http-client/HttplugClient.php:266, Symfony\\Component\\HttpClient\\Exception\\InvalidArgumentException(code: 0): Unsupported scheme in \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\". at /var/www/wallabag/vendor/symfony/http-client/HttpClientTrait.php:523)","milliseconds":2,"uid":"63c121390bba48.27462739"} []

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