Fork me on GitHub
#cursive
<
2019-09-10
>
kenny00:09:22

Just tried opening a REPL in the dev build using Run with Deps and got this printed in an error window:

java/sql/Timestamp
Cloning: 
Checking out:  at c830e77ff9b00f1e27b7e21f2393f83261aec61b
Downloading: com/cerner/clara-rules/0.19.1/clara-rules-0.19.1.pom from 
Downloading: prismatic/schema/1.1.6/schema-1.1.6.pom from 

cfleming01:09:26

BTW when this happened, did the REPL start ok, or did it fail to start?

cfleming01:09:19

When you say this appeared in an error window, do you mean a notification, or in the Event Log?

cfleming01:09:10

And it looks like this REPL doesn’t execute a main namespace or anything like that, correct? The aliases are just pulling in extra deps + source paths?

kenny14:09:09

Failed to start. I think it opened in the Run tab. Correct -- no main ns, just extra deps/paths.

cfleming22:09:20

So I can’t reproduce this, or come up with a plausible explanation for why it might happen. Most of the Clojure bugs related to this were fixed in 1.9.0, but there may be dependencies somewhere provoking this problem. However I can’t see how they could be invoked during the REPL classpath calculation using deps (using lein yes, because of plugins).

cfleming22:09:42

Very long shot: do you for some reason have #inst reader macros in your deps.edn files anywhere?

kenny22:09:22

No haha. I can try to repro this again if it'd be helpful.

cfleming22:09:45

That would be great if you could, thanks.

cfleming22:09:07

Could you also check your log (Help | Show log in Explorer/Finder) to see if there’s any mention of Timestamp there?

kenny22:09:25

My first attempt did not work. It does appear to calculate the classpath each time I open a REPL using Run with Deps.

kenny22:09:26

Found this

kenny22:09:26

There's a bunch of those. They all look the same.

kenny22:09:34

Can't get the error to occur anymore. Very strange.

cfleming23:09:15

Ok, so there’s definitely something in your build somewhere using the s3 wagon. If you can find that and upgrade it, I think that will fix the problem.

cfleming23:09:29

And yes, currently it will re-calculate the classpath on each run. I added the caching to project resolution, and I’ll add it to the classpath calculation hopefully in the next build.

kenny00:09:29

Now that the error is gone, I guess something may have updated that dep? I don't explicitly use s3-wagon anywhere. Oh gotcha. I misread the release notes for it.

cfleming02:09:45

That’s really weird. Could you have an old s3 repo definition kicking around that you don’t use any more? Perhaps in your Maven settings?

cfleming02:09:30

One thing that is suspicious - that error is actually reported as: ERROR - llij.ide.plugins.PluginManager

cfleming02:09:45

I’m wondering if that’s actually an IntelliJ thing and nothing to do with deps at all. If you go to Preferences | Plugins | &lt;gear icon&gt; | Manage repositories, do you have anything there? You’ll probably have which is the Cursive EAP channel - anything else?

kenny13:09:28

Nothing else.

kenny13:09:15

I don't have a settings.xml in my .m2. We used to have the Datomic Ions S3 repo in our :mvn/repos map but got rid of Ions. No :mvn/repos in any of our projects.

cfleming21:09:11

Then that is a total mystery. Something somewhere is trying to use or configure an s3 repo, which is where that error is coming from. I have no idea where it might be though. I guess if things are now working correctly then we can just go with it, and try to figure it out if the problem recurs.

kenny21:09:52

Sounds good.

kenny00:09:07

I've also now gotten to a place where the Aliases folder in the Clojure Deps dropdown is gone.

kenny00:09:47

I was using 2019.2.2. Switched back to 2018.3.6 and the Aliases box came back.

cfleming00:09:15

@kenny The aliases box will probably not appear if the project can’t resolve, so that might actually be the same problem. Based on the java/sql/Timestamp part of the error, that’s because 2019.2 by default uses JDK11. Some Clojure deps aren’t ready for JDK9+ yet, and since the new deps integration (like the lein one) runs some stuff in-process, that can affect it. Unfortunately these error messages are always really obscure and it’s hard to track them down. Are you using s3-wagon-private, for example? If you upgrade that to 1.3.2 this problem should go away, assume that dep is the issue.

kenny00:09:36

One thing that was a bit strange about what I was doing is switching between branches where projects had been removed & added. Not using s3-wagon, to my knowledge.

cfleming00:09:14

Ok, there are other deps with this problem, but that’s been the one that has bitten most people.

kenny00:09:30

All our projects run and are deployed with Java 11. That means it's likely coming in from a dev dep, I guess.

cfleming00:09:53

Yeah, sounds like it.

cfleming00:09:10

I’ll check to see if I can get a better idea of where those errors come from.

kenny00:09:42

The disappearing aliases thing was quite confusing though. Is there a way to show an error message instead?

cfleming00:09:09

Did you see an error about the project resolution failing?

kenny00:09:24

Maybe. I'll try to reproduce it again. What would make it harder to notice is when switching between branches that have removed modules. It seems like every time I switch a branch I get 1-3 notification boxes which makes noticing error messages a lot harder.

cfleming00:09:06

What are the notification boxes? If they’re from Cursive I can try to reduce that or combine them somehow.

kenny00:09:36

After just doing the switch again, I got 2: Refresh deps and Update npm deps

kenny00:09:50

Shouldn't modules be branch dependent?

cfleming00:09:14

How do you mean?

kenny00:09:15

Oh, and another one is: > Workspace associated with branch 'platformization' has been restored

cfleming00:09:54

Right, IntelliJ does that - basically that means that it stores things like open files, window layout, breakpoints etc per branch, and when you switch it restores them.

kenny00:09:40

Yeah it's useful but adds to the notification noise when switching branches.

cfleming00:09:35

Right, unfortunately I can’t change any of that. The only one I can control is the deps refresh one, that you won’t see when I fix auto-import if you have that enabled, but the others are out of my control

kenny00:09:58

In master I have modules: a, b In branch1 I have modules: a, c Module a & b seen in Clojure Deps when in master and modules a and c when in branch1.

cfleming00:09:24

Is that not what you’re seeing?

kenny01:09:06

No. Modules persist across branches. Sometimes I'll get an error about a module disappearing when switching between branches as well. I can't seem to reproduce the latter right now.

cfleming01:09:31

Yeah, thinking about it I can see why that might happen. I’ll think about that and try to fix it.

kenny01:09:53

The actual directory for the module may still exist when switching to a branch without the module (e.g. it contains unversioned files like node_modules) but will not contain a deps.edn.

cfleming01:09:14

Ok. I think I can check that and fix it.

kenny01:09:19

Any idea how to figure out the problem dep for that java/sql/Timestamp thing?

kenny01:09:49

It must have something to do with Cursive since I can open a REPL in the CLI without getting that exception.

cfleming01:09:44

No, I’m going to think about that and see if I can reproduce it and improve the error message.

kenny01:09:00

e.g. I can do this in the CLI

clj -A:dashboard:dev:test
Clojure 1.10.1
user=> 
But if I type dashboard,test,dev in the Run with Deps in Cursive and start I REPL, I get the Timestamp error.

cfleming01:09:27

Yeah, the way this works is that Cursive runs the project resolution in-process in an isolated classloader, which makes it a lot faster for larger projects. The issue is that the JDK used is always the IntelliJ boot JDK, this was almost never a problem previously, but after JDK9 it’s a issue.

kenny01:09:55

Even weirder is it only happens when I use Run with Deps. If I select Run with IntelliJ project classpath with the above aliases selected, it works.

cfleming01:09:18

Can you isolate the dep more by trying those aliases one by one? I guess each one can probably have a lot of deps in it though.

cfleming01:09:50

Yeah, run with IntelliJ classpath doesn’t do anything at all to calculate the classpath, because IntelliJ already has it recorded.

kenny01:09:11

I think I know the problem dep because I've had issues with it before - metasoarous/oz

cfleming01:09:47

Ok, does upgrading that to latest help?

kenny01:09:06

Trying that now. I can probably override deps to get it to work too.

kenny01:09:56

Latest still has the issue.

cfleming01:09:23

But actually running your project with that dep on JDK11 doesn’t have the problem, right?

kenny01:09:56

What do you mean by "actually running"?

cfleming01:09:15

Actually, thinking about this I’m not sure this makes sense for deps. Lein has this problem because the dev deps run arbitrary code during project resolution via plugins - Deps doesn’t do that.

cfleming01:09:06

Well, presumably oz is actually used for something in your project. That project works if you run it e.g. from the command line, right?

kenny01:09:14

If I use the "Run with IntelliJ project classpath" and load a ns uses Oz, it will work.

cfleming01:09:24

i.e. it doesn’t look like oz has a problem with JDK 11.

cfleming01:09:54

I think there’s something else going on here, and the more I think about it the more I think it might be something in deps itself that Cursive is doing differently.

cfleming01:09:11

I have to step out for a bit, but I’ll be back later and I’ll see if I can repro this issue.

kenny01:09:24

Ok. I'm going to head out for the evening. Can look at it more tomorrow. The dashboard does have this dep:

;; explicitly include this dep to fix a jetty version conflict
                                            com.cognitect/http-client {:mvn/version "0.1.99"}
which could also be the problem here.

cfleming01:09:08

Ok. I’ll see if I can come up with a project which repros the problem.

kenny20:09:43

Loaded up an existing project with a module that no longer existed and received: