Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading duplicate firmware gives unfriendly error message #1473

Closed
rraub opened this issue Aug 27, 2024 · 1 comment · Fixed by #1627
Closed

Uploading duplicate firmware gives unfriendly error message #1473

rraub opened this issue Aug 27, 2024 · 1 comment · Fixed by #1627
Assignees
Labels
bug Something isn't working next up UI/UX

Comments

@rraub
Copy link
Contributor

rraub commented Aug 27, 2024

Describe the bug
When uploading a firmware build that has already been uploaded successfully, you are given a generic "Unknown error uploading firmware.
" error message rather than a more specific message saying its a duplicate. The logs show

To Reproduce
Steps to reproduce the behavior:

  1. Go to the /firmware/upload page
  2. Click on the box to upload firmware
  3. Select a firmware build
  4. upload
  5. go back to the /firmware/upload page
  6. try and re upload the same firmware that you did in the previous step
  7. See error Unknown error uploading firmware.

Expected behavior
A message saying this firmware has already been uploaded, so that I don't think there's something wrong with the firmware build.

Screenshots
Screenshot 2024-08-27 at 9 00 10 AM

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Error logs observed:

16:00:59.167 [error] pid=<0.1763.0> mfa=NervesHub.Firmwares.create_firmware/3 Error while publishing firmware: #Ecto.Changeset<action: :insert, changes: %{size: 32461873, version: "1.xx", description: "xx", author: "xx", org_id: x, product_id: x, uuid: "x", platform: "x", architecture: "armx, delta_updatable: x, org_key_id: x, upload_metadata: %{"s3_key" => "firmware/x/x.fw"}}, errors: [uuid: {"has already been taken", [constraint: :unique, constraint_name: "firmwares_product_id_uuid_index"]}], data: #NervesHub.Firmwares.Firmware<>, valid?: false>
@joshk
Copy link
Collaborator

joshk commented Aug 28, 2024

Thanks for reporting this bug.

I'll work on a test for this and see if we can roll out a fix soon.

@joshk joshk added bug Something isn't working next up UI/UX labels Aug 28, 2024
@joshk joshk self-assigned this Aug 28, 2024
@nshoes nshoes self-assigned this Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next up UI/UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@joshk @rraub @nshoes and others