Warning: opendir(private://backup_migrate/): Failed to open directory

Created on 13 December 2023, about 1 year ago
Updated 7 September 2024, 4 months ago

Problem/Motivation

When visiting the backups overview page (/admin/config/development/backup_migrate/backups), the following warning is displayed:

Warning: opendir([..]/private/files/backup_migrate): Failed to open directory: No such file or directory in Drupal\Core\StreamWrapper\LocalStream->dir_opendir() (line 415 of core/lib/Drupal/Core/StreamWrapper/LocalStream.php).

Drupal\Core\StreamWrapper\LocalStream->dir_opendir('private://backup_migrate/', 0)
opendir('private://backup_migrate/') (Line: 252)
Drupal\backup_migrate\Core\Destination\DirectoryDestination->getAllFileNames() (Line: 138)
Drupal\backup_migrate\Core\Destination\DirectoryDestination->listFiles(5) (Line: 97)

Steps to reproduce

Visit the backups overview page (/admin/config/development/backup_migrate/backups) without the backup folder existing.

Proposed resolution

Early return an empty array if the directory does not yet exist. I don't think it should be automatically created when just listing files, the directory can be created when actually creating the first backup.

πŸ› Bug report
Status

Closed: duplicate

Version

5.1

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024