mirror of
https://github.com/koel/koel.git
synced 2026-04-25 16:56:02 +03:00
[GH-ISSUE #637] Postgres error on first sync: Unique violation #456
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#456
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @svalo on GitHub (Aug 18, 2017).
Original GitHub issue: https://github.com/koel/koel/issues/637
Configuration:
OS: archlinux
Postgres version:9.6.3
MariaDB version:10.1.26-MariaDB
Php version: 7.1.8
Koel is configured using php-fpm + nginx
I'm encountering the following error on a clean install of koel using postgres. If I use mariadb issue doesn't appear.
On first sync i receive:
As suggested by #138 I tried to execute commands but failed, has to raise from 2 to 3 to make koel start to sync the library.
After
php artisan koel:initin the db I have:Seems like when seeding the DB the last_value field in the sequences does not get incremented, are there any updates from the situation linked in #138 ?
@phanan commented on GitHub (Aug 19, 2017):
Is there a command in PostreSQL to set the auto increment seed value? In MySQL we have
AUTO_INCREMENT, but I don't know much about Postres.@svalo commented on GitHub (Aug 26, 2017):
Sorry, I'm not an expert in postgres and this was the first time I met laravel so I don't really know :(
@phanan commented on GitHub (Aug 26, 2017):
Then why don't you just use MySQL? :)
@svalo commented on GitHub (Aug 26, 2017):
I was experimenting using koel on a Olinuxino with not much RAM and CPU and in my experience I found Postgres behaving better in such scenario so I tried :) Don't want to start a discussion Postgres vs MySQL :)
@srsgores commented on GitHub (Aug 29, 2017):
Just got this too, on first scan.
Using postgres too. Has anyone found a way to circumvent this problem?
@svalo commented on GitHub (Aug 29, 2017):
@srsgores you can try what is suggested in #138, the ALTER SEQUENCE bit.
To be sure about which number is correct for you, you can execute the following 2 queries agains koel db:
select max(id) from albums;select * from albums_id_seq;The first query will output the IDs of the albums present in the DB, while the second will output the status of the sequence.
For koel to work I had to execute the query in #138 with the value of the first query+1
You'll probably step into the same problem with the artists table, just follow the same instructions changing the tables accordingly