[GH-ISSUE #705] Help with sync and duplication error. #498

Closed
opened 2026-02-26 02:33:23 +03:00 by kerem · 3 comments
Owner

Originally created by @pitylee on GitHub (Jan 3, 2018).
Original GitHub issue: https://github.com/koel/koel/issues/705

On the Koel v3.7.0 commit 64be4f5 I am experiencing a strange issue.

Happening on Ubuntu running on Arm with full setup (npm, gulp, php, lamp, errthing) even xsendfile set up.

After a successfull init, and my post about how to init and install the webpack mix node module, and how to generate the webpack mix json and the assets found installing comment here and generating comment here what I did was:

Downloaded the SQL and rewrote all the charsets in the database's dump, but also did change'em in pma, related to the issue found here about initial duplicate error everything was fine, could log in, but can not scan the media path saying on the command:
php artisan koel:sync --force

Koel syncing started.

In Album.php line 85:

Trying to get property of non-object

Anyone has an idea why is this happening? I know, it's:
` // If this is a compilation album, its artist must be "Various Artists"
if ($isCompilation) {
$artist = Artist::getVariousArtist();
}

    return self::firstOrCreate([
        'artist_id' => $artist->id, // <- this line, artist variable would never be filled with new Artist, my guess
        'name' => $name ?: self::UNKNOWN_NAME,
    ]);

`

Any help would be greately appreciated, as I want to have a player for my open NAS and haven't yet set up with @thebigmunch/gmusicapi-scripts.

Thanks in advance.

Cheers, guys!

Originally created by @pitylee on GitHub (Jan 3, 2018). Original GitHub issue: https://github.com/koel/koel/issues/705 **On the Koel v3.7.0 commit 64be4f5** I am experiencing a strange issue. _Happening on Ubuntu running on Arm with full setup (npm, gulp, php, lamp, errthing) even xsendfile set up._ After a successfull init, and my post about how to init and install the webpack mix node module, and how to generate the webpack mix json and the assets found [installing comment here](https://github.com/phanan/koel/issues/557#issuecomment-355008468) and [generating comment here](https://github.com/phanan/koel/issues/557#issuecomment-355032827) what I did was: Downloaded the SQL and rewrote all the charsets in the database's dump, but also did change'em in pma, related to the issue found [here about initial duplicate error](https://github.com/phanan/koel/issues/452#issue-177495278) everything was fine, could log in, but can not scan the media path saying on the command: ` php artisan koel:sync --force` > Koel syncing started. > > > In Album.php line 85: > > Trying to get property of non-object Anyone has an idea why is this happening? I know, it's: ` // If this is a compilation album, its artist must be "Various Artists" if ($isCompilation) { $artist = Artist::getVariousArtist(); } return self::firstOrCreate([ 'artist_id' => $artist->id, // <- this line, artist variable would never be filled with new Artist, my guess 'name' => $name ?: self::UNKNOWN_NAME, ]); ` Any help would be greately appreciated, as I want to have a player for my open NAS and haven't yet set up with @thebigmunch/[gmusicapi-scripts](https://github.com/thebigmunch/gmusicapi-scripts). Thanks in advance. Cheers, guys!
Author
Owner

@pitylee commented on GitHub (Jan 3, 2018):

As this is an issue I've met already the second time, I am devoted to contribute by documenting my way to resolving it.

As my attempt above failed while messing with the migrated database, I strongly believe it was a huge mistake.

I have dropped all the tables in the DB and ran php artisan koel:init again, and it populated the database successfully again with the user I've set in .env (just realized I've lost everything I've set in .env - shame, I had all the API-s set up)

I re-run the php artisan koel:sync command and now it seems to be able to sync, as 63% of my music library was successfully synced as I'm writing, 1734/2652 is imported.

Will get back with results and a quick review on going to prod from demo.

<!-- gh-comment-id:355103315 --> @pitylee commented on GitHub (Jan 3, 2018): As this is an issue I've met already the second time, I am devoted to contribute by documenting my way to resolving it. As my attempt above failed while messing with the migrated database, I **strongly believe it was a huge mistake**. I have dropped all the tables in the DB and ran `php artisan koel:init` again, and it populated the database successfully again with the user I've set in .env (just realized I've lost everything I've set in .env - shame, I had all the API-s set up) I re-run the `php artisan koel:sync` command and now it seems to be able to sync, as 63% of my music library was successfully synced as I'm writing, 1734/2652 is imported. Will get back with results and a quick review on going to prod from demo.
Author
Owner

@pitylee commented on GitHub (Jan 4, 2018):

After the initial sync, that succeeded only ~70%, the second sync showed this error:

( 1/1297) Failed to upload -- /mnt/data/Music/Billboard Hot 100 Singles Chart (7th Oct 2017) (Mp3 320kbps) [Hunter]/Billboard Hot 100 Singles Chart (7th Oct 2017)/76. Carly Pearce - Every Little Thing.mp3 (c0ef0ce7-b3d7-3d34-8354-4d2fd2d5d04b) | ALREADY EXISTS
( 2/1297) Failed to upload -- /mnt/data/Music/FUNKY SHIT MASTER FINAL.mp3 (a2036d93-b3c1-3157-aa3f-ac2bf7273893) | ALREADY EXISTS
Traceback (most recent call last):
File "/home/[myuser]/.pyenv/versions/3.6.0/bin/gmsync", line 11, in
load_entry_point('gmusicapi-scripts==0.5.0', 'console_scripts', 'gmsync')()
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi_scripts/gmsync.py", line 202, in main
mmw.upload(songs_to_upload, enable_matching=cli['match'], delete_on_success=cli['delete-on-success'])
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi_wrapper/decorators.py", line 22, in wrapper
return function(*args, **kwargs)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi_wrapper/musicmanager.py", line 303, in upload
for result in self._upload(filepaths, enable_matching=enable_matching, transcode_quality=transcode_quality):
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi_wrapper/musicmanager.py", line 256, in _upload
filepath, enable_matching=enable_matching, transcode_quality=transcode_quality
File "", line 2, in upload
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/utils/utils.py", line 616, in wrapper
return function(*args, **kw)
File "", line 2, in upload
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/utils/utils.py", line 593, in wrapper
return function(*args, **kw)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/clients/musicmanager.py", line 500, in upload
self.uploader_id)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/clients/shared.py", line 84, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/protocol/shared.py", line 207, in perform
req_kwargs = cls.build_request(*args, **kwargs)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/protocol/shared.py", line 89, in build_request
val = val(*args, **kwargs)
File "", line 2, in dynamic_data
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/protocol/musicmanager.py", line 70, in pb
return msg.SerializeToString()
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/python_message.py", line 1042, in SerializeToString
return self.SerializePartialToString(**kwargs)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/python_message.py", line 1051, in SerializePartialToString
self._InternalSerialize(out.write, **kwargs)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/python_message.py", line 1071, in InternalSerialize
field_descriptor._encoder(write_bytes, field_value, deterministic)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/encoder.py", line 759, in EncodeRepeatedField
local_EncodeVarint(write, element.ByteSize(), deterministic)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/python_message.py", line 1020, in ByteSize
size += field_descriptor._sizer(field_value)
File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/encoder.py", line 247, in FieldSize
l = local_len(value.encode('utf-8'))
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 7-8: surrogates not allowed

SO yeah, some kind of modifications are needed in the database. :(

<!-- gh-comment-id:355280319 --> @pitylee commented on GitHub (Jan 4, 2018): After the initial sync, that succeeded only ~70%, the second sync showed this error: > ( 1/1297) Failed to upload -- /mnt/data/Music/Billboard Hot 100 Singles Chart (7th Oct 2017) (Mp3 320kbps) [Hunter]/Billboard Hot 100 Singles Chart (7th Oct 2017)/76. Carly Pearce - Every Little Thing.mp3 (c0ef0ce7-b3d7-3d34-8354-4d2fd2d5d04b) | ALREADY EXISTS > ( 2/1297) Failed to upload -- /mnt/data/Music/FUNKY SHIT MASTER FINAL.mp3 (a2036d93-b3c1-3157-aa3f-ac2bf7273893) | ALREADY EXISTS > Traceback (most recent call last): > File "/home/[myuser]/.pyenv/versions/3.6.0/bin/gmsync", line 11, in <module> > load_entry_point('gmusicapi-scripts==0.5.0', 'console_scripts', 'gmsync')() > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi_scripts/gmsync.py", line 202, in main > mmw.upload(songs_to_upload, enable_matching=cli['match'], delete_on_success=cli['delete-on-success']) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi_wrapper/decorators.py", line 22, in wrapper > return function(*args, **kwargs) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi_wrapper/musicmanager.py", line 303, in upload > for result in self._upload(filepaths, enable_matching=enable_matching, transcode_quality=transcode_quality): > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi_wrapper/musicmanager.py", line 256, in _upload > filepath, enable_matching=enable_matching, transcode_quality=transcode_quality > File "<decorator-gen-74>", line 2, in upload > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/utils/utils.py", line 616, in wrapper > return function(*args, **kw) > File "<decorator-gen-73>", line 2, in upload > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/utils/utils.py", line 593, in wrapper > return function(*args, **kw) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/clients/musicmanager.py", line 500, in upload > self.uploader_id) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/clients/shared.py", line 84, in _make_call > return protocol.perform(self.session, self.validate, *args, **kwargs) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/protocol/shared.py", line 207, in perform > req_kwargs = cls.build_request(*args, **kwargs) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/protocol/shared.py", line 89, in build_request > val = val(*args, **kwargs) > File "<decorator-gen-63>", line 2, in dynamic_data > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/gmusicapi/protocol/musicmanager.py", line 70, in pb > return msg.SerializeToString() > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/python_message.py", line 1042, in SerializeToString > return self.SerializePartialToString(**kwargs) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/python_message.py", line 1051, in SerializePartialToString > self._InternalSerialize(out.write, **kwargs) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/python_message.py", line 1071, in InternalSerialize > field_descriptor._encoder(write_bytes, field_value, deterministic) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/encoder.py", line 759, in EncodeRepeatedField > local_EncodeVarint(write, element.ByteSize(), deterministic) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/python_message.py", line 1020, in ByteSize > size += field_descriptor._sizer(field_value) > File "/home/[myuser]/.pyenv/versions/3.6.0/lib/python3.6/site-packages/google/protobuf/internal/encoder.py", line 247, in FieldSize > l = local_len(value.encode('utf-8')) > UnicodeEncodeError: 'utf-8' codec can't encode characters in position 7-8: surrogates not allowed SO yeah, some kind of modifications are needed in the database. :(
Author
Owner

@BrookeDot commented on GitHub (Apr 22, 2020):

Hi @pitylee

I'm closing this as stale but please to re-open if you are still having trouble with the latest version of Koel.

<!-- gh-comment-id:617602822 --> @BrookeDot commented on GitHub (Apr 22, 2020): Hi @pitylee I'm closing this as stale but please to re-open if you are still having trouble with the latest version of Koel.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#498
No description provided.