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

Publishing fails with code 400 /api/version #325

Open
emilianya opened this issue Feb 27, 2023 · 5 comments
Open

Publishing fails with code 400 /api/version #325

emilianya opened this issue Feb 27, 2023 · 5 comments

Comments

@emilianya
Copy link

I am using electron-forge to publish to ERS, my builds worked fine for 30 or so updates, and then started failing on all but 1 platform.
Linux builds work fine since they finish first, but mac and windows builds fail with this error.

After a bit of testing i found that the response is as follows:

{
    "code": "E_UNIQUE",
    "message": "Would violate uniqueness constraint-- a record already exists with conflicting value(s).",
    "modelIdentity": "version",
    "attrNames": [
        "id"
    ]
}

The only successful api responses i have gotten have the id in the format of 0.1.0_null, even though the api request specifies something else after the _

@greenbeam-ita
Copy link

I got the same

@emilianya
Copy link
Author

my solution was to completely wipe the database, then it started functioning again.

that is obviously not a good solution

@emilianya
Copy link
Author

emilianya commented May 24, 2023

Alrighty i hit version 0.1.34 and it exploded again
19|ers | verbo: Sending 400 ("Bad Request") response:
19|ers | AdapterError: Would violate uniqueness constraint-- a record already exists with conflicting value(s).

well about a month ago but i got lazy and annoyed so I just ignored the issue

@payneWeave
Copy link

We believe there is some kind of default limit on the number of versions that get returned on the /api/version endpoint. For us we found it to be roughly 30. The endpoint also isn't sorted so it isn't deterministic as to when you will experience the issue.

I believe the fix is to either keep your list of versions smaller than 30, or add a sort function to the default sails response for /api/version sorting on updatedAt should do the trick.

@payneWeave
Copy link

payneWeave commented Nov 30, 2023

Related issue in electron-forge: electron/forge#3430
Related PR to fix the issue in electron-forge: electron/forge#3431
Related issue in sails.js: balderdashy/sails#6542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants