Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error message "Code Recommenders cannot download its model repository index"

Tags:

java

eclipse

My Eclipse works fine, but now, periodically a message box comes up saying

Code Recommenders cannot download its model repository index

What does this mean?

like image 859
Ted pottel Avatar asked Aug 05 '19 14:08

Ted pottel


People also ask

Why can't I download models from code recommenders?

As written in the other answer, Code Recommenders has been archived due to lack of active maintainers, see this forum post. Therefore when the plugin tries to download the models it fails because the site does not exist anymore, and you will see the following error dialog:

Is it possible to download & install code recommenders in Eclipse?

At least Eclipse was able to download & install code recommenders via the Install feature Is there anything in the logs? Nope. Is there any way to enable kinda 'detailed log' or debug this somehow?

How do I fix a Maven repository error when indexing?

If you have an indexed repository, but still get a Maven repository error, check the following options: In the Settings/Preferences dialog Ctrl+Alt+S, go to Build, Execution, Deployment | Build Tools | Maven.

How do I fix the Maven repository error in IntelliJ IDEA?

Try to have 127.0.0.1 localhost in the etc/hosts file. Also, make sure there are no other IP addresses mapped to localhost. If the error indicates the Maven repository issue, such as the Failed to update Maven indices error, try to check if Maven repositories were indexed correctly. IntelliJ IDEA works with repository indexes.


3 Answers

As written in the other answer, Code Recommenders has been archived due to lack of active maintainers, see this forum post.

Therefore when the plugin tries to download the models it fails because the site does not exist anymore, and you will see the following error dialog: Code Recommenders error dialog

While you could choose to ignore this download failure in the future, I am not sure if Code Recommenders actually does anything without its models (please correct me if I am wrong), so at this point you could also uninstall the plugin.

OR, you could download the models manually:

  1. Download the archived data of Code Recommenders: https://archive.eclipse.org/archived_projects/recommenders.tgz (9.7 GB!)
  2. Extract recommenders/downloads/models/photon
  3. In Eclipse: Open "Window" > "Preferences" > "Code Recommenders" > "Models"
  4. Remove the existing download.eclipse.org entry
  5. Add a new entry with a file URI pointing to the folder you extracted earlier. Note that you have to percent escape the URI, e.g.
    C:\Program Files\eclipse\recommenders becomes file:///C:/Program%20Files/eclipse/recommenders
  6. Click the "Apply" (and Close) button

Note however, that since you downloaded the files locally and there is no active development, you won't get recommendations for new Java features.

like image 146
Marcono1234 Avatar answered Oct 24 '22 08:10

Marcono1234


If you go to "Preferences"/"Code Recommenders"/"Models" you will see some Repository URL's listed. In my case it is http://download.eclipse.org/recommenders/models/photon/.

But when you call that URL you will get a 404 since the site has been archived in July 2019.

So this URL beeing invalid causes the Error. Since the URL is not available is seems save to silently ignore it, as beeing suggested in the error-dialog.

As beeing said in the Reviews on eclipse Marketplace the project is archived due to lack of comitting developers. And you may find an archived last version here: https://repo.eclipse.org/content/shadows/releases.unzip/org/eclipse/recommenders/stable/

like image 25
Kimses Avatar answered Oct 24 '22 08:10

Kimses


I don't want any of you to have to download 10 gigabytes like in @Marcono1234's solution, so I re-uploaded version-specific code recommender models to mega.nz and shared them here.

  1. Download the code recommenders

For Eclipse Juno users: https://mega.nz/file/tuRFGYQD#zB_mq6XwO7nupLqMDRWQRnnhD3-FAgT3ijtDQyGvjFE

For Eclipse Kelper users: https://mega.nz/file/NjxXFYyb#uwpP3zxESL02prgTimhDL35xPXMnDkbDwzrhJG1rcgc

For Eclipse Luna users: https://mega.nz/file/02g1DASB#3GSzaKtFSGsxhdnNx2aX47DoD22ZZ6aUu9eXTUvoxKg

For Eclipse Mars users: https://mega.nz/file/xnQDTQLC#wmA0cfL_ChVHuQ9r0Mo_Js3ef_eDyg2yU6Z2_JTUPbE

For Eclipse Neon users: https://mega.nz/file/siBF1QYC#aVfX3-FS5sNfLmRqCPg6eUaovQPpEkMqIPWugv3E3qk

For Eclipse Oxygen users: https://mega.nz/file/9nAjUITQ#BpQ4HagdlrfZOelW8jqVgJWI-5QlA38JLCGpGoMbWpc

For Eclipse Photon users: https://mega.nz/file/oq5klCBR#vB8f0vmPH3gaYGwkw7U1SVThW5IxKMuvhBughN-sJi4

  1. Extract it to any folders you want (in my case, c:\workspaces\eclipse\recommenders)
  2. In Eclipse: Open "Window" > "Preferences" > "Code Recommenders" > "Models"
  3. Remove the default entry
  4. Add a file URL to the path you extracted your code recommender model. In my case, it's file://workspaces/eclipse/recommenders.
  5. Click the "Apply" (and Close) button
  6. Enjoy!
like image 41
Jessie Lesbian Avatar answered Oct 24 '22 10:10

Jessie Lesbian