-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Migration fails on startup - albumIds is empty #426
Comments
Hello! Weird to see this happening. There is litterally an if statement checking if there are more than 0 elements to fetch. I feel like there are "missing" album ids equal to "". Checking this. Also, I fear that if I fix this condition, the UI might start panicking because there is one song that does not have an album, which is uncommon. It would be very helpful if you had the id of the track. For the moment I'll just add the ids of the tracks whose album is missing, so that we can debug this more easily. |
Weirdly enough none of these queries return anything.
Do you have suggestions on queries to run? |
I have no idea why this happens honestly. |
Thanks for the quick look! I've tried the new release and attached the findings below. Logs:
Checking the entry for the track with missing album:
[
{
_id: ObjectId('6697f14aaa47a0e30b21d6cc'),
album: null,
artists: [ '6zpub6jbY6CdrcqQsDq8P4' ],
available_markets: [
'AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY',
'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'GR', 'GT', 'HN', 'HK',
'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ',
'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE',
'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID', 'JP', 'TH',
'VN', 'RO', 'IL', 'ZA', 'SA', 'AE', 'BH', 'QA', 'OM', 'KW', 'EG', 'MA',
'DZ', 'TN', 'LB', 'JO', 'PS', 'IN', 'BY', 'KZ', 'MD', 'UA', 'AL', 'BA',
'HR', 'ME', 'MK', 'RS', 'SI', 'KR', 'BD', 'PK', 'LK', 'GH', 'KE', 'NG',
'TZ', 'UG', 'AG', 'AM', 'BS', 'BB', 'BZ', 'BT', 'BW', 'BF', 'CV', 'CW',
'DM', 'FJ', 'GM', 'GE', 'GD', 'GW', 'GY', 'HT', 'JM', 'KI', 'LS', 'LR',
'MW', 'MV', 'ML', 'MH', 'FM', 'NA', 'NR', 'NE', 'PW', 'PG', 'WS', 'SM',
'ST', 'SN', 'SC', 'SL', 'SB', 'KN', 'LC', 'VC', 'SR', 'TL', 'TO', 'TT',
'TV', 'VU', 'AZ', 'BN', 'BI', 'KH', 'CM', 'TD', 'KM', 'GQ', 'SZ', 'GA',
'GN', 'KG', 'LA', 'MO', 'MR', 'MN', 'NP', 'RW', 'TG', 'UZ', 'ZW', 'BJ',
'MG', 'MU', 'MZ', 'AO', 'CI', 'DJ', 'ZM', 'CD', 'CG', 'IQ', 'LY', 'TJ',
'VE', 'ET', 'XK'
],
disc_number: 1,
duration_ms: 168693,
explicit: false,
external_ids: { isrc: 'SEAYD7402030' },
external_urls: {
spotify: 'https://open.spotify.com/track/5nf0T9pVhJPXlgYGSXJhpc'
},
href: 'https://api.spotify.com/v1/tracks/5nf0T9pVhJPXlgYGSXJhpc',
id: '5nf0T9pVhJPXlgYGSXJhpc',
is_local: false,
name: 'Öppna din himmel',
popularity: 34,
preview_url: 'https://p.scdn.co/mp3-preview/67c30a8a29cb40d8500c345f937c5a1fa55d5ac6?cid=968eaeeb405f4715a69f9f7575a3717a',
track_number: 2,
type: 'track',
uri: 'spotify:track:5nf0T9pVhJPXlgYGSXJhpc',
__v: 0
}
] Apparently the issue is a I'm guessing the album id should be |
Interesting, so this seems fixable. I feel like there should be a step where it finds tracks with null albums and fetch the id from the Spotify api. |
As it was just the one album, I decided to patch the database. Everything's working fine now. Tell me if there's a fix you want me to try out. I could just remove the album entry I created and set the album back to |
Goat move right there. I can try implementing the fix I stated above next time I work on this. |
I've had this issue on 1.8.0 as well. I just upgraded to 1.11.0, here are some additional information that may help: Initial error
`db.tracks.find({id: "7v9Q0dAb9t7h8gJOkcJHay"})`
Running |
Describe the bug
Using version 1.10.1, on the line referenced below, the API logs that there are no
albumIds
, yet albums are fetched from the Spotify API. This causes the API to respond with 400 bad request, which in turn seems to crash the migration - resulting in the your Spotify API never starting.your_spotify/apps/server/src/tools/database.ts
Line 76 in 7f7f884
Expected behavior
When there are no
albumIds
found to be missing, no requests should be made to the Spotify API. The migration should complete.My guess is that the root cause is something different, though, as there is already a check that
allTracks
contains at least one track, before extracting thealbumIds
. So why that would turn out empty is anyone's guess.Additional context
Full logs (tokens and IPs redacted) are attached.
logs.txt
Screenshots
N/A
Shared link
I can't login as the API service fails to start.
The text was updated successfully, but these errors were encountered: