{"action":"created","issue":{"url":"https://api.github.com/repos/hexpm/hex/issues/284","repository_url":"https://api.github.com/repos/hexpm/hex","labels_url":"https://api.github.com/repos/hexpm/hex/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/hexpm/hex/issues/284/comments","events_url":"https://api.github.com/repos/hexpm/hex/issues/284/events","html_url":"https://github.com/hexpm/hex/issues/284","id":173029327,"number":284,"title":"** (File.Error) could not remove files and directories recursively from \"<path>\": file already exists","user":{"login":"OvermindDL1","id":401605,"avatar_url":"https://avatars.githubusercontent.com/u/401605?v=3","gravatar_id":"","url":"https://api.github.com/users/OvermindDL1","html_url":"https://github.com/OvermindDL1","followers_url":"https://api.github.com/users/OvermindDL1/followers","following_url":"https://api.github.com/users/OvermindDL1/following{/other_user}","gists_url":"https://api.github.com/users/OvermindDL1/gists{/gist_id}","starred_url":"https://api.github.com/users/OvermindDL1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OvermindDL1/subscriptions","organizations_url":"https://api.github.com/users/OvermindDL1/orgs","repos_url":"https://api.github.com/users/OvermindDL1/repos","events_url":"https://api.github.com/users/OvermindDL1/events{/privacy}","received_events_url":"https://api.github.com/users/OvermindDL1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-24T18:50:02Z","updated_at":"2016-08-25T14:29:41Z","closed_at":null,"body":"This is posted here from https://github.com/elixir-lang/elixir/issues/5155 as per josevalim.\r\n\r\n### Precheck\r\n\r\nKeep getting this error in a few cases, such as in the phoenix reloader this happens constantly:\r\n```elixir\r\n** (File.Error) could not remove files and directories recursively from \"c:/Users/<myuser>/Projects/my_server/_build/dev/lib/my_server/priv\": file already exists\r\n    (elixir) lib/file.ex:919: File.rm_rf!/1\r\n    (mix) lib/mix/utils.ex:317: Mix.Utils.symlink_or_copy/2\r\n    (mix) lib/mix/project.ex:414: Mix.Project.build_structure/2\r\n    (phoenix) lib/phoenix/code_reloader/server.ex:111: Phoenix.CodeReloader.Server.mix_compile/1\r\n    (phoenix) lib/phoenix/code_reloader/server.ex:83: Phoenix.CodeReloader.Server.mix_compile/3\r\n    (phoenix) lib/phoenix/code_reloader/server.ex:40: anonymous fn/2 in Phoenix.CodeReloader.Server.handle_call/3\r\n    (phoenix) lib/phoenix/code_reloader/server.ex:132: Phoenix.CodeReloader.Server.proxy_io/1\r\n    (phoenix) lib/phoenix/code_reloader/server.ex:38: Phoenix.CodeReloader.Server.handle_call/3\r\n    (stdlib) gen_server.erl:615: :gen_server.try_handle_call/4\r\n    (stdlib) gen_server.erl:647: :gen_server.handle_msg/5\r\n    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3\r\n```\r\nas well as just got it while running `mix deps.update --all`:\r\n\r\n```bash\r\n$ mix deps.update --all\r\n* Updating logger_file_backend (https://github.com/onkel-dirtus/logger_file_backend.git)\r\nRunning dependency resolution\r\nDependency resolution completed\r\n  apex: 0.5.2\r\n  base64url: 0.0.1\r\n  bbmustache: 1.0.4\r\n  bunt: 0.1.6\r\n  cachex: 1.2.2\r\n  canada: 1.0.1\r\n  certifi: 0.4.0\r\n  cf: 0.2.1\r\n  combine: 0.9.2\r\n  connection: 1.0.4\r\n  cowboy: 1.0.4\r\n  cowlib: 1.0.2\r\n  credo: 0.4.9\r\n  db_connection: 1.0.0-rc.5\r\n  decimal: 1.1.2\r\n  dialyxir: 0.3.5\r\n  dogma: 0.1.7\r\n  ecto: 2.0.4\r\n  edeliver: 1.4.0\r\n  erlware_commons: 0.21.0\r\n  eternal: 1.0.3\r\n  exrm: 1.0.8\r\n  exrm_docker: 0.1.0\r\n  fs: 0.9.2\r\n  getopt: 0.8.2\r\n  gettext: 0.11.0\r\n  guardian: 0.12.0\r\n  guardian_db: 0.7.0\r\n  hackney: 1.6.1\r\n  happy: 1.3.1\r\n  httpoison: 0.8.3\r\n  idna: 1.2.0\r\n  inch_ex: 0.5.3\r\n  jose: 1.8.0\r\n  ldap_ex: 0.2.4\r\n  metrics: 1.0.1\r\n  mime: 1.0.1\r\n  mimerl: 1.0.2\r\n  mix_test_watch: 0.2.6\r\n  nimble_csv: 0.1.0\r\n  ok_jose: 2.0.0\r\n  permission_ex: 0.4.0\r\n  phoenix: 1.2.1\r\n  phoenix_ecto: 3.0.1\r\n  phoenix_html: 2.6.2\r\n  phoenix_live_reload: 1.0.5\r\n  phoenix_pubsub: 1.0.0\r\n  plug: 1.2.0\r\n  poison: 2.2.0\r\n  poolboy: 1.5.1\r\n  postgrex: 0.11.2\r\n  providers: 1.6.0\r\n  ranch: 1.2.1\r\n  relx: 3.20.0\r\n  ssl_verify_fun: 1.1.0\r\n  timex: 2.2.1\r\n  timex_ecto: 1.1.3\r\n  tzdata: 0.5.9\r\n  ueberauth: 0.3.0\r\n  uuid: 1.1.4\r\n* Updating phoenix (Hex package)\r\n  Checking package (https://repo.hex.pm/tarballs/phoenix-1.2.1.tar)\r\n  Fetched package\r\n** (File.Error) could not remove files and directories recursively from \"c:/Users/<myuser>/Projects/my_server/deps/phoenix\": file already exists\r\n    (elixir) lib/file.ex:919: File.rm_rf!/1\r\n    (hex) lib/hex/scm.ex:111: Hex.SCM.checkout/1\r\n    (mix) lib/mix/dep/fetcher.ex:61: Mix.Dep.Fetcher.do_fetch/3\r\n    (mix) lib/mix/dep/converger.ex:174: Mix.Dep.Converger.all/9\r\n    (mix) lib/mix/dep/converger.ex:114: Mix.Dep.Converger.all/7\r\n    (mix) lib/mix/dep/converger.ex:99: Mix.Dep.Converger.all/4\r\n    (mix) lib/mix/dep/converger.ex:50: Mix.Dep.Converger.converge/4\r\n    (mix) lib/mix/dep/fetcher.ex:16: Mix.Dep.Fetcher.all/3\r\n```\r\nhowever I am able to manually delete the directories and can continue in all cases.\r\n\r\nUsing Process Explorer shows there are no applications holding on to those directories, thus this implies there is a race condition between elixir/mix itself doing something else and the `File.rm_rf` call.\r\n\r\n### Environment\r\n\r\n* Mix version: Mix 1.3.1\r\n* Elixir version:  Elixir 1.3.1  Erlang/OTP 19 [erts-8.0] [64-bit] [smp:8:8] [async-threads:10]\r\n* Operating system:  Windows 10\r\n\r\n### Current behavior\r\n\r\nIt is throwing a \"file already exists' error when deleting a directory.\r\n\r\n### Expected behavior\r\n\r\n`File.rm_rf` should delete a directory tree without throwing a 'file already exists' error while successfully deleting the directory."},"comment":{"url":"https://api.github.com/repos/hexpm/hex/issues/comments/242407710","html_url":"https://github.com/hexpm/hex/issues/284#issuecomment-242407710","issue_url":"https://api.github.com/repos/hexpm/hex/issues/284","id":242407710,"user":{"login":"ericmj","id":316890,"avatar_url":"https://avatars.githubusercontent.com/u/316890?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmj","html_url":"https://github.com/ericmj","followers_url":"https://api.github.com/users/ericmj/followers","following_url":"https://api.github.com/users/ericmj/following{/other_user}","gists_url":"https://api.github.com/users/ericmj/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmj/subscriptions","organizations_url":"https://api.github.com/users/ericmj/orgs","repos_url":"https://api.github.com/users/ericmj/repos","events_url":"https://api.github.com/users/ericmj/events{/privacy}","received_events_url":"https://api.github.com/users/ericmj/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T14:29:41Z","updated_at":"2016-08-25T14:29:41Z","body":"That error seems to be from phoenix code reloader. It's not the same as the one you pasted in the issue."}}
{"actor":{"display_login":"ericmj"}}