Bug 8051 - Importing layer fails silently if the layer name already exists
Summary: Importing layer fails silently if the layer name already exists
Status: ACCEPTED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium normal
Target Milestone: 5.99
Assignee: David Reyna
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-07-27 10:27 UTC by Belen Barros Pena
Modified: 2025-06-11 08:58 UTC (History)
9 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
screenshot (205.23 KB, image/png)
2015-10-30 09:41 UTC, Cristina Agurida
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Belen Barros Pena 2015-07-27 10:27:53 UTC
This is happening in Fido. Importing layers in master:d9411412d2cc3ae13cb72227c6513202935012af is failing with what looks like a different error, so I am not sure if the problem happens in master as well.

Steps to reproduce:

* Using the fido release, create a project selecting the "Local Yocto Project" release

* Import a layer with a name that matches one of the layers coming from the layer index (for example, meta-oe)

* Create a second project, also selecting the "Local Yocto Project" release

* Import a layer with name meta-oe

Outcome: when you click the "import and add to project" button, nothing happens in the UI, but the console shows this message:

"hint-layer-exists-with-different-url : importlayer.js:151"

The problem seems to happen if the layer name you provide already exists in the database (even if it doesn't exist in the project). Change 'meta-oe' to 'meta-webserver' or 'meta-cgl' and you get the same issue. If you give it a name that doesn't match anything in the database (meta-dog), the layer imports without problems. 

We should consider backporting the fix to fido
Comment 1 Michael Wood 2015-08-20 09:11:47 UTC
Patch is waiting on the mailing list for someone to review this.

https://lists.yoctoproject.org/pipermail/toaster/2015-August/002552.html
Comment 3 Cristina Agurida 2015-09-16 11:05:07 UTC
This issue happens on both latest fido and master commits. After a discussion with Belen,we agreed that the problem seems to happen when you enter a layer name that already exists in the database and enter a git url that doesn't match the git url of the layer already in the database.
Comment 4 Michael Wood 2015-10-20 13:55:50 UTC
The error that happens client side is fixed by this commit.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2f52ef4b2f22dc266bbf61bebddbcf8bc65e72c8

The behaviour for the import layer is under review in bug #8429
Comment 5 Cristina Agurida 2015-10-30 09:41:26 UTC
Created attachment 2833 [details]
screenshot
Comment 6 Cristina Agurida 2015-10-30 09:41:57 UTC
When trying to import a layer with a name that already exists in the database but a different git url the problem is still reproducible.  "hint-layer-exists-with-different-url" message appears in browser console. 
poky commit: 290534d3ff53b3c0a50e480863474d1785088c5a
Comment 7 Stephen K Jolley 2015-11-18 16:45:30 UTC
This has been REOPENED
Comment 8 Henry Bruce 2016-02-29 20:01:13 UTC
This seems to be fixed in master. As soon as I enter an existing layer name in the Layer Name dialog, I get an error


A layer called iotrp already exists
Layer names must be unqiue. Please use a different layer name.

The iotrp repository url is
ssh://hbruce@git-amr-1.devtools.intel.com:29418/ssg_iot_platform-yocto
Comment 9 Belen Barros Pena 2016-03-01 12:03:30 UTC
(In reply to comment #8)
> This seems to be fixed in master. As soon as I enter an existing layer name
> in the Layer Name dialog, I get an error
> 
This only happens in a very specific situation: when you provide a layer name that already exists in the database for a different project, and you type a different git url to the one recorded for such layer in the database. It's a bit of an edge case. You will never encounter it within a project that already has a layer with the name you have typed.

This is how to reproduce:

1. Create a toaster project using the master release
2. Create a second toaster project choosing the local release
3. In this second local project, click on the 'import layer' tab in the project configuration 
4. Enter 'meta-aarch64' as layer name
5. Enter 'test' as git url
6. Enter 'master' as revision
7. Click the import layer button

Nothing happens. If you check the console log, you will see this message: 

importlayer.js:151 hint-layer-exists-with-different-url

I have been able to reproduce this on master:4006a7f2762ccd5dcbc6cdff49482d4387a73261
Comment 10 David Reyna 2017-01-04 03:02:23 UTC
Michael had marked this "In progress review" but I cannot find any trace of that review.

I will go ahead and grab this case in the mean time.
Comment 11 David Reyna 2017-04-11 23:43:13 UTC
I am moving this back to "accepted". I do not see copies of Michael's previous work in poky-contrib nor in the Toaster email list.
Comment 12 Randy MacLeod 2023-10-24 14:24:35 UTC
Bulk move from 4.99 or 0.00 to 5.99