Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am having a 'Missing file: /file/name.jpg' error when trying to synchronise content among sites.
The sites are multisite instances.
After some digging, I see that this is a user permission error, see the attached screenshot from xdebug.
The error is gone if I remove the following section from the RemoteManager::prepareClient()
$http_client->post('/user/login', [
'form_params' => [
'name' => $remote->get('basic_auth_username'),
'pass' => $remote->get('basic_auth_password'),
'form_id' => 'user_login_form',
],
]);
Comment | File | Size | Author |
---|---|---|---|
shot_20183001-145616.png | 392.74 KB | msti |
Comments
Comment #2
GrimreaperHello,
It depends on the user you use to connect to the server website. It should have the permission to access the file.
Comment #3
mstiThank you for your reply.
This file is in the public:// directory, server by apache directly. Why is it checking for file access?
Comment #4
GrimreaperFor JSON API endpoints, there is no need to authenticate the user on /user/login because it can be authenticated on the fly with the basic_auth.
When trying to access files URL to retrieve the content, the file URL is no a JSON API endpoint so the user needs to be authenticated before and to store the authentication cookie.
I agree that for public files, there is no need for that, but it is required for private files or other stream wrappers.
And we need a generic solution for all stream wrappers, so we authenticate the user on the user login form.
Comment #5
GrimreaperHi msti,
I am closing the issue as there is no reply since 5 months.
Also, Is your website behind and HTTP authentication? If so, maybe it is related to #2930801: Support for HTTP authentication.
Feel free to reopen if needed, providing more info on your server and website setup.