3
votes

When creating a sbt project using IntelliJ IDEA 13.1.4 with the Scala plugin 0.41.2 on Mac OS X 10.9.4, the following error has occurred:

[warn] problem while downloading module descriptor: http://repo1.maven.org/maven2/org/scalatest/scalatest_2.11/2.2.1/scalatest_2.11-2.2.1.pom: /Users/.../.ivy2/cache/org.scalatest/scalatest_2.11/ivy-2.2.1.xml.original.part (Permission denied) (384ms)

which prevents refreshing project dependencies.

What could be the issue and a solution?

1
Could it be that you've been running two sbt sessions and they were accessing the same file simultaneously? It could also be a real permission denied issue so check the permissions of the file path and every directory.Jacek Laskowski
I have only one sbt session. Checking the file access permissions didn't help! The workaround is to run idea as a sudo command.Farshid Zaker
Sudo for IDEA is unacceptable. Let's strive for something better. What user do you run IDEA under? What are the permissions for the .ivy2 directory? I think you once ran sbt/activator/IDEA using sudo and that messed up the local repo's permission. Could you rename .ivy2 directory and start over a sbt session?Jacek Laskowski
The problem was that the .ivy cache was created by typesafe activator which was run as a sudo command. So the owner of .ivy cache files was root. Changing the owner to current user, solved the problem. Thank you for the hints, please post an answer.Farshid Zaker

1 Answers

5
votes

I think you once ran sbt/activator/IDEA using sudo that messed up the local repo's permissions that made root the owner.

Check the permissions of ~/.sbt and ~/.ivy2 directories that should allow the current user to read and write files to the directories.