"invalid argument" error on permission issue

Bug #220434 reported by Rocko on 2008-04-22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)

Bug Description

Binary package hint: nautilus

The error messages returned by Nautilus (or gnomevfs) over Samba aren't very meaningful, eg if you are trying to move a file from a Samba share and the file is read-only, nautilus will copy the file and then tell you it failed to copy it with details of 'invalid parameter'. In fact it does copy it, but it can't delete the original, and it would be great if it could tell you this.

Version info:

ubuntu 8.04 rc
nautilus 1:2.22.2-0ubuntu4
samba/smbclient 3.0.28a-1ubuntu4
libgnomevfs-2.0 1:2.22.0-2ubuntu1

Sebastien Bacher (seb128) wrote :

Thank you for your bug report. Not conforming, nautilus give a message about the location being read only on my hardy installation. Do you have the same issue using gvfs-move? What smb server do you use?

Changed in nautilus:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Incomplete
Rocko (rockorequin) wrote :

The gvfs-move command shows the same output as nautilus:

rocko@ubuntu:~$ gvfs-move smb:// .
Error moving file smb:// Invalid argument

and the copy part of the command works (ie I can see README.txt in . after issuing the command), but the delete fails.

On the server, this file has these permissions:

-r--r--r-- 1 rocko rocko 11402 2006-04-19 23:13 README.txt

Some configuration information:

I installed the samba server with "sudo apt-get install samba" (or the equivalent from Synaptic), ie it's the standard Ubuntu package. It's running on a 32-bit Ubuntu machine.

smbclient is running a 64-bit Ubuntu machine (both are updated to the same versions). I'm trying to copy from the 32-bit machine to the 64-bit machine.

The only modification to /etc/samba/smb.conf that I made on the server are:

force user = rocko

and I added a user called rocko and set a password using "sudo smbpasswd -a rocko".

Sebastien Bacher (seb128) wrote :

not confirming, to send upstream by somebody having the issue

Changed in nautilus:
status: Incomplete → New
Pedro Villavicencio (pedro) wrote :

As Sebastien said, this need to be send upstream by someone having the issue, for forwarding instructions please take a look to https://wiki.ubuntu.com/Bugs/Upstream/GNOME ; I'm leaving this as incomplete until it gets forwarded, thanks.

Changed in nautilus:
status: New → Incomplete
Sebastien Bacher (seb128) wrote :

We are closing this bug report as it lacks the information, described in the previous comments, we need to investigate the problem further. However, please reopen it if you can give us the missing information and don't hesitate to submit bug reports in the future.

Changed in nautilus:
status: Incomplete → Invalid
Rocko (rockorequin) wrote :

Can you try to reproduce it using this method? This way works for me every time and does not require a second machine:

1. Using samba, share a folder 'test' as 'test' on your local machine (with read/write permissions). In the folder, create an empty document 'test1' and make it read-only.

2. Navigate to this folder in nautilus, ie smb://localhost/test, and use the cut command (ctrl-x) on the empty document 'test1'.

3. Navigate to another folder (eg your home folder) and use the paste command (ctrl-c).

Nautilus successfully copies the file 'test1' and then says that it cannot copy [sic] it due to 'invalid parameter'.

If you want to show that the copy was successful, just put some text into test1 before copying it.

Changed in nautilus:
status: Invalid → Incomplete
Sebastien Bacher (seb128) wrote :

gvfs-move has the same issue

Changed in nautilus:
status: Incomplete → Confirmed
Sebastien Bacher (seb128) wrote :

could somebody try if that's still an issue in jaunty?

Changed in gvfs (Ubuntu):
status: Confirmed → Incomplete
Rocko (rockorequin) wrote :

Confirming In Jaunty. Nautilus now says 'Invalid argument' instead of 'Invalid parameter'. Otherwise its behaviour is identical to the original report.

Changed in gvfs (Ubuntu):
status: Incomplete → Confirmed
Sebastien Bacher (seb128) wrote :

could you describe easy steps to trigger the bug on a clean install?

Sebastien Bacher (seb128) wrote :

is that smb specific?

Rocko (rockorequin) wrote :

I believe it is smb-specific, yes.

I've already described easy steps to trigger the bug above, so I assume you'd like some more information on how to apply step 1? Here goes:

To install samba:

sudo apt-get install samba

To share a folder, I normally use nautilus and right-click on the folder and choose 'sharing options' and enter the details when prompted. Hopefully the rest is obvious; perhaps you could report a usability bug if it isn't. Naturally, you should allow the samba user to alter files at this point so that a 'move' is possible.

In order to create the file, in nautilus, I normally use right-click then 'Create Document' and 'Empty File'. If you double-click on the resulting file, nautilus will run gedit, which is an editor that will let you enter text and save the edits via the File / Save menu (or CTRL-S also works).

In order to make the file non-writeable, you could try chmod -w from gnome-terminal or if you prefer a GUI, use nautilus, right-click on the file in question and choose 'Properties', 'Permissions' and 'Read-only'.

Sebastien Bacher (seb128) wrote :

Thanks for the detailled comments, the bug has been sent to the people writting the code on http://bugzilla.gnome.org/show_bug.cgi?id=577740 now

Changed in gvfs (Ubuntu):
status: Confirmed → Triaged
summary: - nautilus/samba gives meaningless error messages
+ "invalid argument" error on permission issue
Changed in gvfs:
status: Unknown → New
Sebastien Bacher (seb128) wrote :

upstream bug comment

"I don't get "invalid argument", I get "permission denied":

gvfs-move smb://maurice/data/temp/git-book.pdf .
Error moving file smb://maurice/data/temp/git-book.pdf: Permission denied

This error is returned by libsmbclient, not gvfs itself. So, I would say it
depends on the samba version. I have samba 3.2.8, which one does it fail with?"

affects: gvfs (Ubuntu) → samba (Ubuntu)
Changed in gvfs (Ubuntu):
assignee: desktop-bugs → nobody
Changed in samba (Ubuntu):
status: Triaged → Confirmed
Sebastien Bacher (seb128) wrote :

confirmed the issue is a samba one, gvfs error log

"map_errno_from_nt_status: 32 bit codes: code=c0000121
smbc errno NT_STATUS_CANNOT_DELETE -> 22"

the samba source has
#define NT_STATUS_CANNOT_DELETE NT_STATUS(0xC0000000 | 0x0121)

the errmap_unix.c table doesn't list that error

" DEBUG(10,("map_errno_from_nt_status: 32 bit codes: code=%08x\n",

        for (i=0;nt_errno_map[i].error;i++) {
                if (NT_STATUS_V(nt_errno_map[i].status) ==
                            NT_STATUS_V(status)) {
                        return nt_errno_map[i].error;

        /* for all other cases - a default code */
        return EINVAL;"

it returns EINVAL

Changed in gvfs:
status: New → Invalid

I've this bug with karmic, every time I try to open a file or copying it to a local folder I get an "Invalid argument" message. With dolphin in KDE, instead I get this error "Impossibile leggere il file ...." (Can't read file xxxx).
Creating file works, though.

just a little update from my previous comment: with Dolphin, the error message pop-up after the attempt to copy the file, leaving truncated file (with a .part extension) as a result.

Rarian Rakista (rakista) wrote :

This needs to be fixed soon. It makes deploying Ubuntu in a production environment next to impossible.

Chuck Short (zulcss) wrote :

I believe this is fixed in a recent version on samba in Karmic. Please test and re-open this bug if you still have issues with it.


Changed in samba (Ubuntu):
status: Confirmed → Fix Released
Rocko (rockorequin) wrote :

This is still present in Karmic alpha 6's samba 2:3.4.0-3ubuntu2.

Changed in samba (Ubuntu):
status: Fix Released → Confirmed
Thierry Carrez (ttx) wrote :

Looking at source3/lib/errmap_unix.c at current tip of git, there is still no specific mapping for NT_STATUS_CANNOT_DELETE, so this bug still stands in upstream code.

Changed in samba (Ubuntu):
status: Confirmed → Triaged
Changed in gvfs:
importance: Unknown → Medium
status: Invalid → Unknown
Damon Hartman (area51pilot) wrote :

This bug is still present in Maverick 10.10. Files copied to a share copy but generate the "invalid argument" popup.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.