SBT Shell Error: Not a valid key: idea-shell

I can't build using SBT since the latest versions of Intellij and the scala plugin. 

I keep getting the error: 

 

[error] Not a valid command: idea-shell (similar: shell)
[error] Not a valid project ID: idea-shell
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: idea-shell (similar: daemon-shell, daemonShell)
[error] idea-shell
[error]

 

 

Any ideas? 

7

Thanks for this report, Alan. I've created an issue: https://youtrack.jetbrains.com/issue/SCL-12923

You're right that the mechanism is pretty brittle, but currently sbt doesn't offer any better way. We'll try to address your problem though.

For the general problem with the "not a valid key: idea-shell", see the issue https://youtrack.jetbrains.com/issue/SCL-12430

The workaround to that seems to be to delete the directory <user home>/.sbt/<sbt version>/plugins/target/

3

This recurred for me as well after the 2018.2.1 update. I added proxy authentication, set sbt.override.repos to false and ran sbt to download the intellij plugins. Of course, nothing else worked, but now it was in my ivy cache. So, I deleted my proxy authentication and restored the sbt.override.repos setting. Easy peezy lemon squeezie.

 

I would suggest that JetBrains start testing their updates on clean machines with no and with artifactory-based internet access.

2
Avatar
Permanently deleted user

@Pascal: It didn't work for me - deleting .idea file. Please help

2
Avatar
Permanently deleted user

I downgraded my project SBT Version from 0.13.16 to 0.13.15 and it all work fines. 

And if I upgrade up to 0.13.16 again it all works for fine.

 

 

1

I just updated my Idea to 2018.2.6 (Build #UI-182.5107.16) and I've got this problem again: 

[error] Not a valid project ID: myProject
[error] project myProject
[error] ^

Neither of fixes proposed here help. Please take a look...

1

Hello, does this issue persist over restarts of IDEA?

Can you check in your <home>/.sbt/0.13/plugins/ or <home>/.sbt/1.0/plugins/ if there is a file idea.sbt and what are its contents?

0
Avatar
Permanently deleted user

It does perist between restarts hence I have stopped using intellij completely till I find a resolution to this.

 

There is a idea.sbt file. I even removed it and restarted intellij to see if it would fix issue by creating a new one. It created a new one but did not fix issue. 

idea.sbt contents: 

// Generated by IntelliJ-IDEA Scala plugin.
// Add settings when starting sbt from IDEA.
// Manual changes to this file will be lost.
if (java.lang.System.getProperty("idea.runid", "false") == "7.0.0+61-051fb9ba") scala.collection.Seq(
addSbtPlugin("org.jetbrains" % "sbt-structure-extractor" % "7.0.0+61-051fb9ba"),
addSbtPlugin("org.jetbrains" % "sbt-idea-shell" % "1.2+7-625c26bc")
) else scala.collection.Seq.empty

0

As discussed on gitter, what helped in this case was downgrading the project sbt version to 0.13.15, then upgrading back to 0.13.16.

Anybody else experiencing this issue, please report any way to reliably reproduce it if you can.

0
Avatar
Permanently deleted user

I have exactly the same issue, I'm using a .sbtopts in the project directory to relocate the SBT cache:

-ivy ../sbt_cache
-sbt-boot ../sbt_cache
-sbt-dir ../sbt_cache

An idea.sbt is put into ~/.sbt directory but seems to be ignored:

$ cat ~/.sbt/0.13/plugins/idea.sbt 
// Generated by IntelliJ-IDEA Scala plugin.
// Add settings when starting sbt from IDEA.
// Manual changes to this file will be lost.
if (java.lang.System.getProperty("idea.runid", "false") == "2017.2") scala.collection.Seq(
addSbtPlugin("org.jetbrains" % "sbt-structure-extractor" % "2017.2"),
addSbtPlugin("org.jetbrains" % "sbt-idea-shell" % "2017.2")
) else scala.collection.Seq.empty

The current mechanism used by intellij seems incredibly fragile.

 

0
Avatar
Permanently deleted user

And if I copy idea.plugins into the relocated SBT cache under a plugins subdirectory I get the following error:

java.lang.AssertionError: assertion failed: Not absolute: ../sbt_cache/plugins

that's coming from within SBT itself. No idea why the plugins directory would need to be an absolute path.

0
Avatar
Permanently deleted user

I keep experiencing the same problem  and I keep doing this, but it's just a temporary fix. It seems like it got worse since 2017.3 . Before that, I was destroying the .idea directory in the project itself and reloading it and that used to work.

Since 2017.3 that doesn't work anymore and this workaround works for a while. Please fix this !!

0
Avatar
Permanently deleted user

What do I have to put in my sbt.repositories to get


addSbtPlugin("org.jetbrains" % "sbt-structure-extractor" % "2017.2"),
addSbtPlugin("org.jetbrains" % "sbt-idea-shell" % "2017.2")

to work?

0

Hi Ion, those should work out of the box with sbt, unless you are somehow blocking or excluding the sbt-plugin-releases repo.

0
Avatar
Permanently deleted user

When I test connection in the Proxy settings for https://bintray.com/sbt/sbt-plugin-releases I get 'read timed out.' Can I download that to my local ivy cache?

0
Avatar
Permanently deleted user

I am also getting this issue 

It started when i upgraded the sbt version i was using

Ive tried the fixes above but nothing seems to work, any suggestions ?

0

Shawty, which sbt version are you on now? Have you tried deleting all the target directories as described in https://youtrack.jetbrains.com/issue/SCL-12430

0

I have the same issue with Idea 2018.2.1. Issue appeared after the Idea update. Worked well with 2018.1. 

The fix proposed in SCL-12430 doesn't work. Tried with SBT 1.1.6 and 1.2.1. 

0
Avatar
Permanently deleted user

I just encountered this issue following

a) upgrade from 2018.2.4 -> 2018.2.5

b) invalidate cache and restart

Upon restart I get 

...
[error] Not a valid command: idea-shell (similar: shell, oldshell)
[error] Not a valid project ID: idea-shell
[error] Expected ':'
[error] Not a valid key: idea-shell (similar: daemonShell)
[error] idea-shell

The fix ( delete target dir) described in https://youtrack.jetbrains.com/issue/SCL-12430 DID resolve it for me

0
Avatar
Permanently deleted user

@Sergii Sopin Deleting .idea in the project did help me.

I described it here: https://stackoverflow.com/questions/53333246/intellij-not-a-valid-project-id 

0

请先登录再写评论。