Arc Forumnew | comments | leaders | submitlogin
System error: Invalid cross-device link; errno=18
2 points by cooler 3939 days ago | 8 comments
Hi all.I'm new to arc.I found an error when I tried to run the HN server.I can open "http://localhost:8080/" successfully by the instructions from "lib/how-to-run-news". But when I tried to sign up,it always jumped to a blank page and the URL became "http://localhost:8080/y",and in the terminal it output the following errors.

"rename-file-or-directory: cannot rename file or directory source path: /var/tmp/cooks.13951390171395139017635 dest path: /home/hello/anarki/arc/cooks system error: Invalid cross-device link; errno=18"

After google I got nothing related to arc but racket. So I guessed it maybe own to racket.Then I updated the racket from v5.1.3 to the latest v6.0 but nothing changed. BTW,my OS is ubuntu 12.04.3. Any one can help me? Thanks in advance.



2 points by rocketnia 3938 days ago | link

The error "Invalid cross-device link" happens if you're trying to move a file across partitions. Apparently sometimes people have set up their home directory in a separate partition, even without realizing it.[1] So I'm guessing you're in a situation like that.

Other languages seem to recover from this particular error and do a copy and unlink instead:

Python: https://mail.python.org/pipermail/python-list/2005-February/...

Ruby: http://stackoverflow.com/questions/403239/how-do-i-move-a-fi...

Racket's reference for 'rename-file-or-directory states that it can move files to other paths "on the same disk"[2], and it goes into detail about atomicity guarantees, so this behavior is probably by design.

So the way you can find resolution here might be:

- Somehow change what temp directory Arc uses.

- Put the Arc directory elsewhere on your filesystem.

- Somehow change your partitions so the home directory and temp directory are in the same one.

- We should probably update Arc to recover from this somehow. :)

---

[1] http://www.linuxquestions.org/questions/linux-newbie-8/inval... (Warning: This page has lots of ads, and there's some flaming with harsh language.)

[2] http://docs.racket-lang.org/reference/Filesystem.html

-----

3 points by cooler 3938 days ago | link

Thanks you for your help.

1. "...So I'm guessing you're in a situation like that."

Yes,you are right.

2. "- Somehow change what temp directory Arc uses."

I don't know how to.

3. "- Somehow change your partitions so the home directory and temp directory are in the same one."

This worked.

BTW, I have tried the old arc3.1 version, but it didn't have the problem.

-----

2 points by akkartik 3937 days ago | link

For future reference, I figured out how to change the temp directory arc/racket uses:

  $ TMPDIR=~/tmp arc.sh
The TMPDIR must exist, otherwise racket will again fall back to defaults.

-----

1 point by akkartik 3938 days ago | link

Ack, accidental downvote. So the 'presence indicator' should really be 3.

-----

2 points by akkartik 3938 days ago | link

Hmm, is /home or /var mounted as a separate device in your setup? Can you show us the output of the following command?

  $ df

-----

2 points by cooler 3938 days ago | link

Thx,you are also right. And the following is the 'df' output:

  Filesystem     1K-blocks    Used Available Use% Mounted on

  /dev/sda5       10787760 7165852   3067260  71% /
  udev             1961728       4   1961724   1% /dev
  tmpfs             787996     972    787024   1% /run
  none                5120       0      5120   0% /run/lock
  none             1969984    1032   1968952   1% /run/shm
  /dev/sda7       28373184 8822232  18103336  33% /home

-----

1 point by zck 3938 days ago | link

The error message indicates you're running anarki. What version are you running? Did you make any changes to it?

-----

2 points by cooler 3938 days ago | link

I just gitclone it,so it should be the latest version,and no change.

Thx.

-----