bhauman / lein-figwheel

Figwheel builds your ClojureScript code and hot loads it into the browser as you are coding!
Eclipse Public License 1.0
2.88k stars 208 forks source link

.figwheel-compile-stamp not found #541

Open JJ-Atkinson opened 7 years ago

JJ-Atkinson commented 7 years ago

After a clean of some sort, figwheel is unable to find .figwheel-compile-stamp in the out directory. My project is based on the hello-world figwheel template, with only minimal changes to the compile settings. The \out\ directory has some weird owner settings on Windows (10 in my case). I can't do anything to the \out\ directory, even though I'm an admin on my machine. I can't change any security settings or even see who owns the file. Not sure if this is a figwheel or leiningen problem.

c:\[...]\cljs-project>lein figwheel
Figwheel: Cutting some fruit, just a sec ...
Figwheel: Validating the configuration found in project.clj
?[32mFigwheel: Configuration Valid :)?[0m
Figwheel: Starting server at http://0.0.0.0:3449
Figwheel: Watching build - dev
Figwheel: Cleaning build - dev
clojure.lang.ExceptionInfo: Error in component :figwheel-system in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start {:reason
 :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key :figwheel-system, :component #figwheel_
sidecar.system.FigwheelSystem{:system #object[clojure.lang.Atom 0x4fc26399 {:status :ready, :val #<SystemMap>}]}, :system #<SystemMap>}
        at clojure.core$ex_info.invokeStatic(core.clj:4617)
        at clojure.core$ex_info.invoke(core.clj:4617)
        at com.stuartsierra.component$try_action.invokeStatic(component.cljc:119)
        at com.stuartsierra.component$try_action.invoke(component.cljc:116)
        at com.stuartsierra.component$update_system$fn__22830.invoke(component.cljc:139)
        at clojure.lang.ArraySeq.reduce(ArraySeq.java:109)
        at clojure.core$reduce.invokeStatic(core.clj:6544)
        at clojure.core$reduce.invoke(core.clj:6527)
        at com.stuartsierra.component$update_system.invokeStatic(component.cljc:135)
        at com.stuartsierra.component$update_system.doInvoke(component.cljc:129)
        at clojure.lang.RestFn.invoke(RestFn.java:445)
        at com.stuartsierra.component$start_system.invokeStatic(component.cljc:163)
        at com.stuartsierra.component$start_system.invoke(component.cljc:155)
        at com.stuartsierra.component$start_system.invokeStatic(component.cljc:161)
        at com.stuartsierra.component$start_system.invoke(component.cljc:155)
        at com.stuartsierra.component.SystemMap.start(component.cljc:178)
        at figwheel_sidecar.system$start_figwheel_system$fn__24594.invoke(system.clj:658)
        at figwheel_sidecar.system$dispatch_system_component_errors.invokeStatic(system.clj:644)
        at figwheel_sidecar.system$dispatch_system_component_errors.invoke(system.clj:642)
        at figwheel_sidecar.system$start_figwheel_system.invokeStatic(system.clj:658)
        at figwheel_sidecar.system$start_figwheel_system.invoke(system.clj:656)
        at figwheel_sidecar.system$start_figwheel_BANG__STAR_.invokeStatic(system.clj:693)
        at figwheel_sidecar.system$start_figwheel_BANG__STAR_.invoke(system.clj:679)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invokeStatic(core.clj:646)
        at clojure.core$apply.invoke(core.clj:641)
        at figwheel_sidecar.system$start_figwheel_BANG_.invokeStatic(system.clj:737)
        at figwheel_sidecar.system$start_figwheel_BANG_.doInvoke(system.clj:695)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at figwheel_sidecar.repl_api$start_figwheel_from_lein.invokeStatic(repl_api.clj:150)
        at figwheel_sidecar.repl_api$start_figwheel_from_lein.invoke(repl_api.clj:146)
        at figwheel_sidecar.repl_api$launch_from_lein.invokeStatic(repl_api.clj:192)
        at figwheel_sidecar.repl_api$launch_from_lein.invoke(repl_api.clj:189)
        at user$eval24670.invokeStatic(form-init7720261485378831622.clj:1)
        at user$eval24670.invoke(form-init7720261485378831622.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6927)
        at clojure.lang.Compiler.eval(Compiler.java:6917)
        at clojure.lang.Compiler.load(Compiler.java:7379)
        at clojure.lang.Compiler.loadFile(Compiler.java:7317)
        at clojure.main$load_script.invokeStatic(main.clj:275)
        at clojure.main$init_opt.invokeStatic(main.clj:277)
        at clojure.main$init_opt.invoke(main.clj:277)
        at clojure.main$initialize.invokeStatic(main.clj:308)
        at clojure.main$null_opt.invokeStatic(main.clj:342)
        at clojure.main$null_opt.invoke(main.clj:339)
        at clojure.main$main.invokeStatic(main.clj:421)
        at clojure.main$main.doInvoke(main.clj:384)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:383)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
Caused by: clojure.lang.ExceptionInfo: Error in component autobuild-dev in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start
{:reason :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key "autobuild-dev", :component #fi
gwheel_sidecar.components.cljs_autobuild.CLJSAutobuild{:build-config {:id "dev", :source-paths ["src" "scripts"], :figwheel {:open-urls ["http://localhost:3449/in
dex.html"], :build-id "dev"}, :watch-paths ["src" "scripts"], :compile-paths ["src" "scripts"], :build-options {:main global.init, :asset-path "/js/compiled/out",
 :output-to "resources/public/js/compiled/global-init.js", :output-dir "resources/public/js/compiled/out", :source-map-timestamp true, :preloads [devtools.preload
], :optimizations :none}, :compiler-env #object[clojure.lang.Atom 0xfb3e6dc {:status :ready, :val #CompilerEnv{}}]}, :figwheel-server #figwheel_sidecar.components
.figwheel_server.FigwheelServer{:connection-count #object[clojure.lang.Atom 0x328f4387 {:status :ready, :val {}}], :browser-callbacks #object[clojure.lang.Atom 0x
6e0d30e4 {:status :ready, :val {}}], :ring-handler nil, :file-change-atom #object[clojure.lang.Atom 0x1c4f7807 {:status :ready, :val ()}], :compile-wait-time 10,
:builds {"dev" {:id "dev", :source-paths ["src" "scripts"], :figwheel {:open-urls ["http://localhost:3449/index.html"], :build-id "dev"}, :watch-paths ["src" "scr
ipts"], :compile-paths ["src" "scripts"], :build-options {:main global.init, :asset-path "/js/compiled/out", :output-to "resources/public/js/compiled/global-init.
js", :output-dir "resources/public/js/compiled/out", :source-map-timestamp true, :preloads [devtools.preload], :optimizations :none}, :compiler-env #object[clojur
e.lang.Atom 0xfb3e6dc {:status :ready, :val #CompilerEnv{}}]}, "min" {:id "min", :source-paths ["src"], :watch-paths ["src"], :compile-paths ["src"], :build-optio
ns {:output-to "resources/public/js/compiled/hello_world.js", :main hello-world.core, :optimizations :advanced, :pretty-print false, :output-dir "resources\\publi
c\\js\\compiled/out"}, :compiler-env #object[clojure.lang.Atom 0xc5ae854 {:status :ready, :val #CompilerEnv{}}]}}, :nrepl-port 7887, :server-port 3449, :ansi-colo
r-output true, :resolved-ring-handler nil, :server-ip "0.0.0.0", :cljs-build-fn #object[figwheel_sidecar.components.cljs_autobuild$color_output$fn__24358 0x430c93
47 "figwheel_sidecar.components.cljs_autobuild$color_output$fn__24358@430c9347"], :http-server #object[clojure.lang.AFunction$1 0x33638e3f "clojure.lang.AFunction
$1@33638e3f"], :open-file-command nil, :unique-id "C:\[...]\cljs-project", :log-writer #object[java.io.BufferedWriter 0x14d2b5bf "java.i
o.BufferedWriter@14d2b5bf"], :file-md5-atom #object[clojure.lang.Atom 0x12932c18 {:status :ready, :val {}}], :css-dirs ["resources/public/css"], :http-server-root
 "public"}}, :system #<SystemMap>}
        at clojure.core$ex_info.invokeStatic(core.clj:4617)
        at clojure.core$ex_info.invoke(core.clj:4617)
        at com.stuartsierra.component$try_action.invokeStatic(component.cljc:119)
        at com.stuartsierra.component$try_action.invoke(component.cljc:116)
        at com.stuartsierra.component$update_system$fn__22830.invoke(component.cljc:139)
        at clojure.lang.ArraySeq.reduce(ArraySeq.java:114)
        at clojure.core$reduce.invokeStatic(core.clj:6544)
        at clojure.core$reduce.invoke(core.clj:6527)
        at com.stuartsierra.component$update_system.invokeStatic(component.cljc:135)
        at com.stuartsierra.component$update_system.doInvoke(component.cljc:129)
        at clojure.lang.RestFn.invoke(RestFn.java:445)
        at com.stuartsierra.component$start_system.invokeStatic(component.cljc:163)
        at com.stuartsierra.component$start_system.invoke(component.cljc:155)
        at com.stuartsierra.component$start_system.invokeStatic(component.cljc:161)
        at com.stuartsierra.component$start_system.invoke(component.cljc:155)
        at com.stuartsierra.component.SystemMap.start(component.cljc:178)
        at com.stuartsierra.component$eval22771$fn__22772$G__22761__22774.invoke(component.cljc:5)
        at com.stuartsierra.component$eval22771$fn__22772$G__22760__22777.invoke(component.cljc:5)
        at clojure.lang.Atom.swap(Atom.java:37)
        at clojure.core$swap_BANG_.invokeStatic(core.clj:2260)
        at clojure.core$swap_BANG_.invoke(core.clj:2253)
        at figwheel_sidecar.system.FigwheelSystem.start(system.clj:118)
        at com.stuartsierra.component$eval22771$fn__22772$G__22761__22774.invoke(component.cljc:5)
        at com.stuartsierra.component$eval22771$fn__22772$G__22760__22777.invoke(component.cljc:5)
        at clojure.lang.Var.invoke(Var.java:379)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.core$apply.invokeStatic(core.clj:648)
        at clojure.core$apply.invoke(core.clj:641)
        at com.stuartsierra.component$try_action.invokeStatic(component.cljc:117)
        ... 50 more
Caused by: java.io.FileNotFoundException: c:\[...]\cljs-project\resources\public\js\compiled\out\.figwheel-compile-stamp (Access is denied)

        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at clojure.java.io$fn__9522.invokeStatic(io.clj:230)
        at clojure.java.io$fn__9522.invoke(io.clj:230)
        at clojure.java.io$fn__9459$G__9428__9466.invoke(io.clj:69)
        at clojure.java.io$fn__9496.invokeStatic(io.clj:166)
        at clojure.java.io$fn__9496.invoke(io.clj:166)
        at clojure.java.io$fn__9472$G__9424__9479.invoke(io.clj:69)
        at clojure.java.io$writer.invokeStatic(io.clj:119)
        at clojure.java.io$writer.doInvoke(io.clj:104)
        at clojure.lang.RestFn.invoke(RestFn.java:410)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.RestFn.applyTo(RestFn.java:132)
        at clojure.core$apply.invokeStatic(core.clj:648)
        at clojure.core$spit.invokeStatic(core.clj:6668)
        at clojure.core$spit.doInvoke(core.clj:6668)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at figwheel_sidecar.config$on_stamp_change.invokeStatic(config.clj:30)
        at figwheel_sidecar.config$on_stamp_change.invoke(config.clj:25)
        at figwheel_sidecar.build_middleware.stamp_and_clean$hook$fn__24331.invoke(stamp_and_clean.clj:61)
        at figwheel_sidecar.components.cljs_autobuild$color_output$fn__24358.invoke(cljs_autobuild.clj:79)
        at figwheel_sidecar.components.cljs_autobuild.CLJSAutobuild.start(cljs_autobuild.clj:255)
        at com.stuartsierra.component$eval22771$fn__22772$G__22761__22774.invoke(component.cljc:5)
        at com.stuartsierra.component$eval22771$fn__22772$G__22760__22777.invoke(component.cljc:5)
        at clojure.lang.Var.invoke(Var.java:379)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.core$apply.invokeStatic(core.clj:648)
        at clojure.core$apply.invoke(core.clj:641)
        at com.stuartsierra.component$try_action.invokeStatic(component.cljc:117)
        ... 77 more
Subprocess failed
bhauman commented 7 years ago

This is very strange behavior. The files and directories are created as the user who launches the lein process. So ...

But specifically it doesn't have permission to access the compile-stamp.

There must be something about how you are running the process ????

Perhaps being Admin is the problem? Maybe create a user and see if you things work that way ...

Hmmm here is a clue Leiningen is a java process that launches another java process so perhaps the second launch has different user/perm setup because of some global setting?

You may want to check with the clojurians.slack.com,to see if someone else is having this issue: sign up at clojurians.net

JJ-Atkinson commented 7 years ago

I tried using a non-admin account, but that didn't work. The only thing that I can think of is that I'm using Hyper as my command line client, and that might have something to do with it... But I tried it with just a plain cmd and still have the same error. I forgot to mention, but I've had this problem before, except the last time the user settings weren't goofed up as bad, so I could still take ownership and create the file. I'll check out the clojurians now.

JJ-Atkinson commented 7 years ago

I just tried to use takeown and icacls under the local system account, and that had no effect either. This folder had some really strange permissions. But, after a restart, the folder was gone. Nothing. Without adding the file, I have no error anymore.

JJ-Atkinson commented 7 years ago

Apparently, I was too quick to assume the problem was resolved. After restarting my computer, the out folder was indeed deleted. However, after the next clean, the folder was goofed again. I had even made sure that I had full permissions before I started lein/figwheel. Apparently, somehow either lein or figwheel are changing the permissions of a pre-existing folder, and somehow raising the permissions so high that even the local system command prompt can't see the owner.

Rovanion commented 7 years ago

Folders can inherit permissions from the parent folder, so look there and see if there is anything strange there. Though I'm not a Windows user so I honestly have no idea how that works over there.

JJ-Atkinson commented 7 years ago

That's not what's happening in this case. No other permissions were changed, just those of the out folder and its subdirectories.

dpmontero commented 6 years ago

In my case, the problem was Dropbox.

We should look at it carefully

invaliduser commented 3 years ago

Just a data point---I had (have) this, OpenJDK Runtime Environment Corretto-15.0.2.7.1 (build 15.0.2+7), Windows, working around it by running as admin.

¯\(ツ)