'Attachment URL' element with tokens gives 'Connection refused for URI' error

Created on 8 February 2024, 5 months ago
Updated 8 April 2024, 3 months ago

Problem/Motivation

I have a webform with an 'Attachment URL' element. The 'filename' and 'URL/path' values for the attachment element are obtained from tokens.

The webform also has an email handler, which is configured to include the attachment in the email.

However, when the webform is submitted, the email is not sent, and the following error is displayed:

Drupal\Core\Entity\EntityStorageException: Connection refused for URI https://global.test/files/private/pdf/4782/FILENAME.pdf in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Also, Drupal DBlog shows the following error:

GuzzleHttp\Exception\ConnectException: Connection refused for URI https://global.test/files/private/pdf/4782/FILENAME.pdf in GuzzleHttp\Handler\StreamHandler->__invoke() (line 72 of /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php).

Having said that, if I copy and paste the URL in the error messages into my browser, the PDF file is accessed/opened without problem, which means the path to the file constructed using tokens is correct, and that the file is in fact accessible.

Ubuntu 22.04 server
Drupal 10.1.5
PHP 8.1.27
Apache/2.4.52
Webform 6.2.2

Any advise would be greatly appreciated.

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

6.2

Component

Code

Created by

πŸ‡―πŸ‡΅Japan jorgemare

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024