Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000893bareos-core[All Projects] webuipublic2018-01-23 08:462018-06-22 17:19
Assigned Tofrank 
PlatformLinuxOSCentOSOS Version7
Product Version17.2.4 
Target VersionFixed in Version 
Summary0000893: webui cannot list dirs with only files in them
DescriptionWe have a user's homedir which contains only files. When trying to browse the backup in the webui, it says: "Oops, something went wrong, probably too many files."
The user has 76 files in his homedir.
Another user's homedir which has files AND folders is browsable.
Steps To ReproduceNot entirely sure, but we use the following fileset resource:

FileSet {
  Name = "p004home"
  Description = "Backup Project 004 user homedirs."
  Include {

     Options {
        exclude = yes
        wilddir = /data/home/*p004/data
        wild = /data/home/*lock_file*
     Options {
        signature = MD5
        wilddir = /data/home/*p004
        wild = /data/home/*p004/*
     Options {
        exclude = yes
        wilddir = /data/home/*

     File = /data/home/
Additional InformationMay be related to: 0000891

Also, it seems that in the output it misses a comma sometimes. If I open the webui in Chrome, choose CTRL+SHIFT+I for developer tools and use network monitoring, I can see that in the last communication before the popup there's something wrong with the json output. First statement is not separated from the second by a comma:
[{"id":"-12408","text":".ssh/","icon":"glyphicon glyphicon-folder-close","state":"","data":{"type":"D","fullpath":"\/data\/home\/tegp004\/.ssh\/","pathid":12408,"fileid":1990019,"stat":{"atime":1516607463,"dev":64770,"ino":9840045,"group":"20503","rdev":0,"mtime":1511276383,"mode":16832,"nlink":2,"user":"20503","size":4096,"ctime":1511276394},"name":".ssh\/","jobid":21643,"lstat":"P0C liWt EHA C FAX FAX A BAA BAA I BaZZfn BaFD9f BaFD9q A A C","linkfileindex":0},"children":true}{"id"...

(Last few words, no comma between } and { )
bareos-master: impact
bareos-master: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action
Attached Filespatch file icon 893.patch [^] (1,166 bytes) 2018-01-23 15:07 [Show Content]

- Relationships
related to 0000891resolvedfrank Webui will not open some windows clients directories 
child of 0000910closed Release bareos-17.2.5 

-  Notes
asger_blekinge (reporter)
2018-01-23 15:10

Uploaded patch that solves the problem.

The problem is that is that if the directory list does not include . and .., the RemoteController will fail when generating JSON output.

It expects the list to contain . and .., which it filters out. But it only puts a , after the directory list if the list contains more than 2 directories. However, if the list does NOT contain . and .., this means the produced JSON will be invalid if the list contains less than 3 normal directories.
asger_blekinge (reporter)
2018-01-23 15:12

So the bug title is actually wrong. It should be something like "webui cannot list directories with at least 1 file and between 1 and 3 direct subdirectories"

And the error message should probably not be "Oops, something went wrong, probably too many files.", but rather "Oops, something went wrong, probably too few directories." ;)
frank (manager)
2018-02-13 18:52

Fix committed to bareos-webui bareos-17.2 branch with changesetid 7738.

- Related Changesets
bareos-webui: bareos-17.2 ee232a6f
Timestamp: 2018-02-13 18:43:11
Author: frank
Ported: N/A
Details ] Diff ]
Fix to bugreport 0000905 and 0000893

Regarding 0000905:

When returning an Ajax result, inside a json string value don't use addslashes.
You don't want both " and ' escaped at the same time. Instead just use

Regarding 0000893:

A misplaced dir and file separator ',' lead to malformed json which could result in
a non loadable subtree.

Fixes 0000893: webui cannot list dirs with only files in them
Fixes 0000905: Restore WebUI - Enable to browse directory when a file name contain a single quote
mod - module/Restore/src/Restore/Controller/RestoreController.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2018-01-23 08:46 tonyalbers New Issue
2018-01-23 15:07 asger_blekinge File Added: 893.patch
2018-01-23 15:10 asger_blekinge Note Added: 0002879
2018-01-23 15:12 asger_blekinge Note Added: 0002880
2018-01-23 15:13 asger_blekinge Tag Attached: webui
2018-01-26 16:29 frank Assigned To => frank
2018-01-26 16:29 frank Status new => assigned
2018-02-13 18:42 frank Status assigned => confirmed
2018-02-13 18:52 frank Changeset attached => bareos-webui bareos-17.2 ee232a6f
2018-02-13 18:52 frank Note Added: 0002909
2018-02-13 18:52 frank Status confirmed => resolved
2018-02-13 18:52 frank Resolution open => fixed
2018-02-13 18:55 frank Relationship added child of 0000910
2018-03-12 11:33 frank Relationship added related to 0000891

Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker