PCmanfm-qt unable to move files to folder

Hello,

When I am trying to move a file to a folder in pcmanfm-qt, it doesn’t work. If I run pcmanfm-qt as root, no issue. Have been tinkering around for a while but was unable to sort that one out. Any idea? I am running Lubuntu 20.04.

Many thanks!

Someone can correct me if I’m wrong, but I think it has to do with file/folder permissions. As you discovered, opening up pcmanfm as root lets you move your files wherever you want 'cause the app instance is running with root privileges vs how it works normally where it doesn’t let you do that. That is, as I understand it, by design and isn’t meant to map 1:1 with how it works like in Windows. Honestly have no clue how other distros or DEs handle that circumstance but I saw this same thing on Lubuntu w/ LXDE when I was still using that.

When I looked up answers, someone from LXDE told me it was not a good idea to open up the app as root and I honestly can’t remember the reason. Think it had something to do with variables but go figure.

Hope that kinda helps.

1 Like

When I looked up answers, someone from LXDE told me it was not a good idea to open up the app as root and I honestly can’t remember the reason.

I am not sure if this is even slightly helpful, but I’ll add it.

I’ve used PCManFM as root for a long time. I even have it aliased - because if I’m starting it from the terminal then that means I want to run it as root.

I do not know enough about PCManFM-qt to opine. They’ve probably resolved any issues, as it has opening it as root built in.

Anyhow, I’ve never experienced any unexpected behavior by running PCManFM as root - and I’ve run it as root more times than I could possibly remember.

1 Like

Yeah, this is likely a permissions issue. You should get a “permission denied” error. However, you can always go to Tool → Open As Root to open a root instance. This will open a new instance of pcmanfm-qt. This is obvious because there’s a red banner at the bottom of the window that is labeled “root instance.” Note that it will also look different because it uses the root user’s settings, not your user’s settings.

Just remember that with great power comes great responsibility.

4 Likes

OK. That’s weird, I checked the permission, it looks good. I’ll use root when needed then.

Many thanks

If you have permissions, you shouldn’t need root. So I wouldn’t call this solved. So what actually happens when you try to make this move that doesn’t work? Is there an error or no error? Could you provide screenshots with permissions information on the files and folders you’re trying to use?

Hello,
Permissions are set as follows: for the folder : “view and modify content” for Owner, Group, Other. For the file : “Read and write” for all three as well.
There is no error message. When I try and move the file to the folder, nothing happens (but if I copy, it does copy the file to the folder…). I tried to reinstall pcmanfm-qt, but didn’t solve the pb. I tried to run pcmanfm-qt from the terminal hoping to get an output, but was not able to get a verbose mode or anything.
That’s just weird. I thought this was some sort of known issue, but it seems I’ll have to wait till the next update, and hopefully that will fix the problem. Many thanks.

screen04

Let’s see what happens if you try to do it like normal:

  1. Open up the terminal (Qterminal is what’s included in Lubuntu).
  2. Type the following on a single line cd /home/jerome/Documents/my_test_folder and then hit Enter.
  3. Type the following on a single line mv new_file.txt my_folder/ and then hit Enter.

Hello,
I did the following:
~/Documents/my_test_folder$ ls -la
(…)
drwxrwxrwx 2 jerome jerome 4096 Jan 20 09:50 my_folder
-rw-rw-rw- 1 jerome jerome 0 Jan 19 09:38 new_file.txt
~/Documents/my_test_folder$ mv new_file.txt my_folder/
~/Documents/my_test_folder$ ls
my_folder
~/Documents/my_test_folder$ cd my_folder/
~/Documents/my_test_folder/my_folder$ ls
new_file.txt

All works fine. It really seems it comes from pcmanfm-qt.

1 Like

Please paste the results of the following:
ls -n /home/
id -u jerome
id -g jerome

~$ ls -n /home/
total 4
drwxr-xr-x 50 1000 1001 4096 Jan 20 16:35 jerome
~$ id -u jerome
1000
~$ id -g jerome
1001
~$

So I did this (using Lubuntu 20.04 I should add):

  • Setup

    1. Open pcmanfm-qt (by default it opens to $HOME)
    2. Right click on an empty space and select Create New > Folder and gave it a name “my_test.”
    3. Double click on the newly created “my_test” folder.
    4. Right click on an empty space and select Create New > Folder and gave it a name “my_test_folder.”
    5. Right click on an empty space and select Create New > Blank File and gave it a name “my_test_file.”
  • Test copying

    1. Drag and drop “my_test_file” to “my_test_folder.”
    2. Select “Copy file here.”
    3. Note that “my_test_file” still exists in the present working directory, “my_test.”
    4. Double click on “my_test_folder.”
    5. Note that “my_test_file” is present.
    6. Right click on “my_test_file” (within “my_test_folder”) and click Move to Trash.
    7. Click the Go Up button to return to the “my_test” folder.
  • Test symlinking

    1. Drag and drop “my_test_file” to “my_test_folder.”
    2. Select “Create symlink here.”
    3. Note that “my_test_file” still exists in the present working directory, “my_test.”
    4. Double click on “my_test_folder.”
    5. Note that a symlink to “my_test_file” is present (the top left of the icon should have an emblem with a clockwise circling arrow).
    6. Right click on “my_test_file” (within “my_test_folder”) and click Move to Trash.
    7. Click the Go Up button to return to the “my_test” folder.
  • Test moving (this appears to be what you were trying to do)

    1. Drag and drop “my_test_file” to “my_test_folder.”
    2. Select “Move file here.”
    3. Note that “my_test_file” no longer exists in the present working directory, “my_test.”
    4. Double click on “my_test_folder.”
    5. Note that “my_test_file” is present.

So everything appears to be working normally.

I tried to be very explicit about what I did and what I observed so there is no ambiguity. Given that, what did you differently?

Hello,
Did everything according to your instructions:

  1. When I fist tried to Drag and Drop, nothing happened and a small red icon popped up close to the file (see screenshot).screen_06

  2. After opening/ closing my_test folder, the context menu was back again.

  3. Copy, symlink work fine, but it still fails when I try and move the file to the folder.

What version of pcmanfm-qt are you running? Please get this by running apt-cache policy pcmanfm-qt. Check libfm with apt-cache policy libfm-qt6, too.

Or if you are on 20.10 apt-cache policy libfm-qt7

Edit
I see now the original post states 20.04 so disregard my comment here.

~$ apt-cache policy pcmanfm-qt
pcmanfm-qt:
Installed: 0.14.1-0ubuntu3
Candidate: 0.14.1-0ubuntu3
Version table:
*** 0.14.1-0ubuntu3 500
500 Index of /ubuntu focal/universe amd64 Packages
100 /var/lib/dpkg/status

~$ apt-cache policy libfm-qt6
libfm-qt6:
Installed: 0.14.1-12ubuntu3
Candidate: 0.14.1-12ubuntu3
Version table:
*** 0.14.1-12ubuntu3 500
500 Index of /ubuntu focal/universe amd64 Packages
100 /var/lib/dpkg/status

Well, that’s what I’ve got, so that’s out.

I made a test folder and made all the permissions for everyone forbidden. When I drag and drop, I still don’t get the :no_entry_sign: symbol. I do get a “Permission denied” dialog that pops up upon selecting one of the popup menu options.

That said, I wonder if this issue isn’t somehow related to the nature of the file and folder. Could you provide the results of both stat and file against both of them?

If nothing there stands out, we might want to use strace to look a little bit deeper into the internals. You can do this and put the log on a pastebin somewhere (e.g. paste.ubuntu.com which you can use with the pastebinit command) and give us the URL:

sudo strace -f -tt -p $(pidof pcmanfm-qt) -e trace=file 2>&1 | tee log

This will limit the stacktrace to those events that relate to files, include microseconds on the timestamp (-tt) and include any forks (-f) of the specific PID (-p) of pcmanfm-qt and then wrap up all the output including errors (2>&1) into the log file.

It’s going to produce a fair amount of output, so I would run it, then open up pcmanfm-qt and directly go to work recreating the bug, then go back and cancel the running strace.

Here is the stat and file output:
https://paste.ubuntu.com/p/mgFRyVdsR7/

and the strace log :
https://paste.ubuntu.com/p/CXst5Fc8Fv/

I haven’t got through the strace yet (I should have told you to keep track of the time when you performed each action so I have to dig through it) but one thing strikes me about the result of stat from both the file and the directory:

 Birth: -

No matter how I create either, I always get a birth date. How did you create these???

Regarding the strace, it doesn’t look like you were trying to do a move but a copy, correct? Let me snip out a bit of your log and remove some of the noise, but then add my annotations:

It's a bit long, so hit this to open it
# this checks to see if you can write to your home
[pid  2356] 09:27:52.202429 access("/home/jerome", W_OK) = 0
# this gets the mode and size of your home
[pid  2356] 09:27:52.202799 stat("/home/jerome", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# this gets the mode and size of your test file
[pid  2356] 09:27:52.203111 lstat("/home/jerome/my_test_file", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
# these check permissions on your test file
[pid  2356] 09:27:52.203844 access("/home/jerome/my_test_file", R_OK) = 0
[pid  2356] 09:27:52.204150 access("/home/jerome/my_test_file", W_OK) = 0
# note that here the -1 status indicates failure, meaning the file is not executable (expected behavior)
[pid  2356] 09:27:52.204424 access("/home/jerome/my_test_file", X_OK) = -1 EACCES (Permission denied)
# the following check the status of the parents of your home
[pid  2356] 09:27:52.205036 lstat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid  2356] 09:27:52.205388 lstat("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# this opens your file as read only
[pid  2356] 09:27:52.211803 openat(AT_FDCWD, "/home/jerome/my_test_file", O_RDONLY) = 29
# this opens a new read/writeable file at in your test folder with 664 permissions
[pid  2356] 09:27:52.212816 openat(AT_FDCWD, "/home/jerome/my_test/my_test_file", O_WRONLY|O_CREAT|O_EXCL, 0664) = 31
# this changes ownership of that new file to you
[pid  2356] 09:27:52.214081 lchown("/home/jerome/my_test/my_test_file", 1000, 1001) = 0
# this checks the mode and size of that new file
[pid  2356] 09:27:52.214487 lstat("/home/jerome/my_test/my_test_file", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
# this changes the permissions of that file to 664
[pid  2356] 09:27:52.214974 chmod("/home/jerome/my_test/my_test_file", 0100664) = 0
# this sets the access and modification times of your new file
[pid  2356] 09:27:52.215263 utimes("/home/jerome/my_test/my_test_file", [{tv_sec=1611166181, tv_usec=292216} /* 2021-01-20T19:09:41.292216+0100 */, {tv_sec=1611166081, tv_usec=175130} /* 2021-01-20T19:08:01.175130+0100 */]) = 0
# this indicates that the thread that was doing all of this work completed successfully
[pid  2356] 09:27:52.216309 +++ exited with 0 +++

So here’s me trying to do a copy:

It's a bit long, so hit this to open it
# this checks that I can write to the folder containing my test folder and file
[pid 62021] 13:33:22.710763 access("/home/lubuntu/New folder", W_OK) = 0
# this gets mode and size of containing folder
[pid 62021] 13:33:22.711178 stat("/home/lubuntu/New folder", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
# these check access of the test file
[pid 62021] 13:33:22.712191 access("/home/lubuntu/New folder/my_test_file", R_OK) = 0
[pid 62021] 13:33:22.712415 access("/home/lubuntu/New folder/my_test_file", W_OK) = 0
[pid 62021] 13:33:22.712623 access("/home/lubuntu/New folder/my_test_file", X_OK) = -1 EACCES (Permission denied)
# these check mode and size of parent folders
[pid 62021] 13:33:22.712850 lstat("/home/lubuntu/New folder", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
[pid 62021] 13:33:22.713065 lstat("/home/lubuntu", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 62021] 13:33:22.713282 lstat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 62021] 13:33:22.713570 lstat("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# this checks extended attributes of my test file
[pid 62021] 13:33:22.713924 statx(AT_FDCWD, "/home/lubuntu/New folder/my_test_file", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0664, stx_size=0, ...}) = 0
# this opens the test file read only
[pid 62021] 13:33:22.714302 openat(AT_FDCWD, "/home/lubuntu/New folder/my_test_file", O_RDONLY) = 29
# these get extended attributes of the file descriptor representing the test file
[pid 62021] 13:33:22.714573 statx(29, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_TYPE, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0664, stx_size=0, ...}) = 0
[pid 62021] 13:33:22.714899 statx(29, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0664, stx_size=0, ...}) = 0
# this creates the new test file in the test folder with permissions 
[pid 62021] 13:33:22.715369 openat(AT_FDCWD, "/home/lubuntu/New folder/my_test_folder/my_test_file", O_WRONLY|O_CREAT|O_EXCL, 0664) = 30
# this gets extended attributes of the file description representing the new test file
[pid 62021] 13:33:22.716107 statx(30, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_MTIME, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0664, stx_size=0, ...}) = 0
# this changes ownership of the new test file
[pid 62021] 13:33:22.716520 lchown("/home/lubuntu/New folder/my_test_folder/my_test_file", 1000, 1001) = 0
# this opens the test file under a new file descriptor read only
[pid 62021] 13:33:22.716796 openat(AT_FDCWD, "/home/lubuntu/New folder/my_test_folder/my_test_file", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_PATH) = 29
# this gets the mode and size of the file descriptor representing the new test file
[pid 62021] 13:33:22.717020 newfstatat(29, "", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_EMPTY_PATH) = 0
# this changes the permissions to 664 of the file descriptor representing the new test file
[pid 62021] 13:33:22.717240 chmod("/proc/self/fd/29", 0100664) = 0
# this changes the access and modification times of the new file
[pid 62021] 13:33:22.717470 utimensat(AT_FDCWD, "/home/lubuntu/New folder/my_test_folder/my_test_file", [{tv_sec=1611351164, tv_nsec=947931000} /* 2021-01-22T13:32:44.947931000-0800 */, {tv_sec=1611351164, tv_nsec=947931000} /* 2021-01-22T13:32:44.947931000-0800 */], 0) = 0
# thread finishes successfully
[pid 62021] 13:33:22.718307 +++ exited with 0 +++

As you can see, there are some differences, most likely due to me running a development version, but it kind of seems like everything worked out very similarly and without errors. So now I’m really confused.