Skip to content

fix(installer): clear message when re-installing over an existing admin email#190

Merged
fabiodalez-dev merged 1 commit into
mainfrom
fix/installer-duplicate-admin-message
Jun 23, 2026
Merged

fix(installer): clear message when re-installing over an existing admin email#190
fabiodalez-dev merged 1 commit into
mainfrom
fix/installer-duplicate-admin-message

Conversation

@fabiodalez-dev

Copy link
Copy Markdown
Owner

While building the Docker image (headless install), an adversarial review surfaced that the installer's createAdminUser() re-throws the raw PDOException when utenti.email already exists.

When it bites (main app): re-running the installer against a database that survived while the .installed marker was lost — a failed-install retry, a DB restore without the marker, or a docroot/marker mishap. The wizard then shows a raw SQL error instead of something actionable. (In Docker this is the normal recreate lifecycle, handled separately in the pinakes-docker image; this PR hardens the upstream installer too.)

Fix: catch the duplicate-key (SQLSTATE 23000 / Duplicate entry) and throw a clear, localized message ("A user with the email %s already exists…"). New i18n key added to all four locales (it/en/fr/de) in the same commit. No change to the happy path.

PHPStan L5 clean.

…in email

createAdminUser() re-threw the raw PDOException on a duplicate utenti.email,
so re-running the installer against a database that survived while the
.installed marker was lost (failed-install retry, DB restore without the
marker, docroot/marker mishap) surfaced a raw SQL error. Catch the duplicate
key (SQLSTATE 23000 / 'Duplicate entry') and throw a clear, localized message
pointing at the real cause. New i18n key added to all four locales.
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fabiodalez-dev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 39 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 182561bb-6f55-4b03-a6b1-7d8f2115edcd

📥 Commits

Reviewing files that changed from the base of the PR and between cb7f21d and bbe4b18.

📒 Files selected for processing (5)
  • installer/classes/Installer.php
  • locale/de_DE.json
  • locale/en_US.json
  • locale/fr_FR.json
  • locale/it_IT.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/installer-duplicate-admin-message

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fabiodalez-dev fabiodalez-dev merged commit 966f125 into main Jun 23, 2026
6 checks passed
@fabiodalez-dev fabiodalez-dev deleted the fix/installer-duplicate-admin-message branch June 23, 2026 21:49
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

Successfully merging this pull request may close these issues.

1 participant