cockpit-file-sharing icon indicating copy to clipboard operation
cockpit-file-sharing copied to clipboard

Share path warning message displayed in error

Open markdhooper opened this issue 2 years ago • 0 comments

A warning message is displayed indicating that the path to a samba share does not exist when it does:

cockpit-file-sharing_path_warning

[root@rockygw1 ~]# stat /mnt/cephfs/samba
  File: /mnt/cephfs/samba
  Size: 2               Blocks: 0          IO Block: 65536  directory
Device: 62h/98d Inode: 1099511627777  Links: 4
Access: (0775/drwxrwxr-x)  Uid: (202303/    boss)   Gid: (200512/domain admins)
Context: unconfined_u:object_r:cephfs_t:s0
Access: 2022-06-27 14:25:44.333645216 -0300
Modify: 2022-06-27 14:29:55.285938146 -0300
Change: 2022-06-27 14:31:34.394801044 -0300
 Birth: 2022-06-27 14:25:44.333645216 -0300
[root@rockygw1 ~]# echo $?
0

This may stem from checkIfExists() in SambaShareEditor.vue being called before tmpShare.path is assigned its proper value. It seems to have a default value of "", or whatever value that props.share.path has initially (object is assigned in tmpShareInit()).

`		watch(() => props.share, () => {
			tmpShareInit();
		}, { lazy: false });

tmpShareInit() is also called in onMounted(): onMounted(() => tmpShareInit());

And again in a cancel function:

		const cancel = () => {
			tmpShareInit();
			emit('hide');
		}

This seems to be a race condition so it isn't consistently reproduced, have to refresh the browser a couple of times to reliably reproduce.

markdhooper avatar Jun 27 '22 20:06 markdhooper