New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming file on network share failed in OSX #358

Closed
vPriVate opened this Issue Dec 12, 2015 · 8 comments

Comments

Projects
None yet
6 participants
@vPriVate

Hi!
I'm using the OSX-version (latest) and trying to add tags to files on my network share. This doesn't work, a file can't be renamed by TagSpaces (Error: Renaming failed). R/W-access to this network-volume should be set up correctly, I can add or rename files in Finder to this folder manually.
With local folders it works fine. What else is needed to connect to files on a netwok share?

@vPriVate

This comment has been minimized.

Show comment
Hide comment
@vPriVate

vPriVate Dec 13, 2015

Let's specify the problem. These are my steps:

  1. Download and install latest version (2.0.4) for Mac
  2. Adding a network share (volume on my NAS, tested via AFP, SMB and WebDAV)
  3. All documents within the share are available. I can open them, I even can create new files or delete existing files successfully!
  4. But I can't get it working to edit a filename or add a tag.

There is a warning in the developer tools when I open my location:
Listing directory: /Volumes/<volume_name>/.ts failed Error: ENOENT: no such file or directory, scandir '/Volumes/<volume_name>/.ts'
Maybe it has something to do with this issue.
There is no log-entry when a file can't be renamed :(
Any ideas? Thanks for your help!

Let's specify the problem. These are my steps:

  1. Download and install latest version (2.0.4) for Mac
  2. Adding a network share (volume on my NAS, tested via AFP, SMB and WebDAV)
  3. All documents within the share are available. I can open them, I even can create new files or delete existing files successfully!
  4. But I can't get it working to edit a filename or add a tag.

There is a warning in the developer tools when I open my location:
Listing directory: /Volumes/<volume_name>/.ts failed Error: ENOENT: no such file or directory, scandir '/Volumes/<volume_name>/.ts'
Maybe it has something to do with this issue.
There is no log-entry when a file can't be renamed :(
Any ideas? Thanks for your help!

@Meralman

This comment has been minimized.

Show comment
Hide comment
@Meralman

Meralman Dec 27, 2015

Same problem here. Totally different setup.
Windows 7
12 gb i7
No joy on tags.

Same problem here. Totally different setup.
Windows 7
12 gb i7
No joy on tags.

@mgabb

This comment has been minimized.

Show comment
Hide comment
@mgabb

mgabb Dec 29, 2015

Same here. Mac OS X Yosemite, latest TagSpaces (2.0.4). Tested on shares mounted via AFP, SMB and NFS.

mgabb commented Dec 29, 2015

Same here. Mac OS X Yosemite, latest TagSpaces (2.0.4). Tested on shares mounted via AFP, SMB and NFS.

@lewis-whittaker-robots

This comment has been minimized.

Show comment
Hide comment
@lewis-whittaker-robots

lewis-whittaker-robots Jan 20, 2016

Hi all,
We are having the same problem using the tagging system, Has anyone found a way to fix this yet?

Mac OS X Yosemite, latest TagSpaces (2.0.4). Tested on shares mounted via AFP Nasbox.

It works fine on local host when on shard documents I can see and add files but can not re-wright the names of files so can not apply tags.

Hi all,
We are having the same problem using the tagging system, Has anyone found a way to fix this yet?

Mac OS X Yosemite, latest TagSpaces (2.0.4). Tested on shares mounted via AFP Nasbox.

It works fine on local host when on shard documents I can see and add files but can not re-wright the names of files so can not apply tags.

@asbachb

This comment has been minimized.

Show comment
Hide comment
@asbachb

asbachb Apr 8, 2016

Contributor

I dived a little into the code. Following error message is thrown:

Error: ENOTSUP: operation not supported on socket, link '/Volumes/documents/2006/tagged/A' -> '/Volumes/documents/2006/tagged/B.pdf' at Error (native)

electron.api.js:531

Contributor

asbachb commented Apr 8, 2016

I dived a little into the code. Following error message is thrown:

Error: ENOTSUP: operation not supported on socket, link '/Volumes/documents/2006/tagged/A' -> '/Volumes/documents/2006/tagged/B.pdf' at Error (native)

electron.api.js:531

@asbachb

This comment has been minimized.

Show comment
Hide comment
@asbachb

asbachb Apr 8, 2016

Contributor

I just get a little deeper into the code.

function doRename () {
    if (clobber) {
      fs.rename(source, dest, function (err) {
        if (!err) return callback()

        if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') {
          rimraf(dest, function (err) {
            if (err) return callback(err)
            options.clobber = false // just clobbered it, no need to do it again
            mv(source, dest, options, callback)
          })
          return
        }

        // weird Windows shit
        if (err.code === 'EPERM') {
          setTimeout(function () {
            rimraf(dest, function (err) {
              if (err) return callback(err)
              options.clobber = false
              mv(source, dest, options, callback)
            })
          }, 200)
          return
        }

        if (err.code !== 'EXDEV') return callback(err)
        moveAcrossDevice(source, dest, clobber, limit, callback)
      })
    } else {
      fs.link(source, dest, function (err) {
        if (err) {
          if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM') {
            moveAcrossDevice(source, dest, clobber, limit, callback)
            return
          }
          callback(err)
          return
        }
        fs.unlink(source, callback)
      })
    }
  }

So the linking is not supported at least on AFP shares. For example when you set clobber to true and fs.rename is invoked everything works just fine.

@uggrock Do you think this can be fixed within the application or do wee need to report this upstream?

Contributor

asbachb commented Apr 8, 2016

I just get a little deeper into the code.

function doRename () {
    if (clobber) {
      fs.rename(source, dest, function (err) {
        if (!err) return callback()

        if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') {
          rimraf(dest, function (err) {
            if (err) return callback(err)
            options.clobber = false // just clobbered it, no need to do it again
            mv(source, dest, options, callback)
          })
          return
        }

        // weird Windows shit
        if (err.code === 'EPERM') {
          setTimeout(function () {
            rimraf(dest, function (err) {
              if (err) return callback(err)
              options.clobber = false
              mv(source, dest, options, callback)
            })
          }, 200)
          return
        }

        if (err.code !== 'EXDEV') return callback(err)
        moveAcrossDevice(source, dest, clobber, limit, callback)
      })
    } else {
      fs.link(source, dest, function (err) {
        if (err) {
          if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM') {
            moveAcrossDevice(source, dest, clobber, limit, callback)
            return
          }
          callback(err)
          return
        }
        fs.unlink(source, callback)
      })
    }
  }

So the linking is not supported at least on AFP shares. For example when you set clobber to true and fs.rename is invoked everything works just fine.

@uggrock Do you think this can be fixed within the application or do wee need to report this upstream?

asbachb added a commit to asbachb/tagspaces that referenced this issue Apr 8, 2016

Added flag to enable overwriting destination (which is already checke…
…d before).

This causes that the underlying code does not use links which does not work for network shares (at least AFP)

Fixes #358
@asbachb

This comment has been minimized.

Show comment
Hide comment
@asbachb

asbachb Apr 14, 2016

Contributor

My fix was merged in develop branch. Perhaps some one could double check if it fixes your problem and post your system / network share type combination.

Contributor

asbachb commented Apr 14, 2016

My fix was merged in develop branch. Perhaps some one could double check if it fixes your problem and post your system / network share type combination.

@uggrock

This comment has been minimized.

Show comment
Hide comment
@uggrock

uggrock Apr 14, 2016

Member

The fix from @asbachb is part of the prerelease 2.2.4

Member

uggrock commented Apr 14, 2016

The fix from @asbachb is part of the prerelease 2.2.4

@uggrock uggrock changed the title from Renaming file on network share failed to Renaming file on network share failed in OSX Apr 14, 2016

@uggrock uggrock closed this Apr 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment