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

Created on 13 December 2023, 7 months ago
Updated 25 June 2024, 3 days 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

Needs review

Version

5.0

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.69.0 2024