[PR #10709] [MERGED] Fix Invoice Ninja Error 500 by restoring file ownership after artisan commands #8937

Closed
opened 2026-02-26 16:34:36 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/10709
Author: @Copilot
Created: 1/11/2026
Status: Merged
Merged: 1/11/2026
Merged by: @MickLesk

Base: mainHead: copilot/fix-invoice-ninja-error-500


📝 Commits (2)

  • e4ddf76 Initial plan
  • 634e83a Fix Invoice Ninja Error 500 by ensuring proper file ownership after artisan commands

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 install/invoiceninja-install.sh (+1 -0)

📄 Description

✍️ Description

Invoice Ninja setup fails with Error 500 after database initialization. Artisan commands (migrate, db:seed, optimize) run as root and modify file ownership, breaking web server access.

Change: Added chown -R www-data:www-data /opt/invoiceninja after database setup completes.

$STD php artisan optimize
chown -R www-data:www-data /opt/invoiceninja  # ← ensures www-data owns all files
msg_ok "Set up Database"

Initial ownership (lines 88-90) is set before artisan commands run. This restoration ensures nginx can serve the application.

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.
Original prompt

This section details on the original issue you should resolve

<issue_title>Invoice ninja Error 500</issue_title>
<issue_description>### Have you read and understood the above guidelines?

yes

🔎 Did you run the script with verbose mode enabled?

Yes, verbose mode was enabled and the output is included below

📜 What is the name of the script you are using?

Invoice ninja

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/invoiceninja.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 13

📈 Which Proxmox version are you on?

9.1.1

📝 Provide a clear and concise description of the issue.

The script runs
Install works
Setuping the database works
Setuping the app returns error 500

🔄 Steps to reproduce the issue.

Run the script
Open the page for setup
enter the database creds
enter your username email and password
enter then error 500
if available try the custom domain name

Paste the full error output (if available).

Processing triggers for php8.4-fpm (8.4.16-1+020251218.39+debian131.gbp6f1a69) ...
✔️ Setup PHP 8.4
✔️ Deployed: invoiceninja (5.12.41)
✔️ Configured InvoiceNinja
Downloading Chromium for PDF GenerationStarting download. Ungoogled Chrome
Extracting
Archive extracted.
Completed! ungoogled currently in use.
✔️ Downloaded Chromium for PDF Generation
Setting up Database
INFO Configuration cache cleared successfully.

INFO Application cache cleared successfully.

INFO Route cache cleared successfully.

INFO Compiled views cleared successfully.

INFO Preparing database.

Creating migration table ............................................................................................................ 52.30ms DONE

INFO Loading stored database schemas.

database/schema/mysql-schema.sql ......................................................................................................... 9s DONE

INFO Running migrations.

2019_15_12_112000_create_elastic_migrations_table ................................................................................... 55.93ms DONE
2024_10_08_034355_add_account_e_invoice_quota ....................................................................................... 78.18ms DONE
2024_10_09_220533_invoice_gateway_fee ................................................................................................ 1.41ms DONE
2024_10_11_151650_create_e_invoice_tokens_table .................................................................................... 216.78ms DONE
2024_10_11_153311_add_e_invoicing_token .............................................................................................. 1.93ms DONE
2024_10_14_214658_add_routing_id_to_vendors_table ................................................................................... 78.08ms DONE
2024_10_18_211558_updated_currencies ............................................................................................... 128.49ms DONE
2024_11_11_043923_kill_switch_licenses_table ........................................................................................ 81.01ms DONE
2024_11_19_020259_add_entity_set_to_licenses_table .................................................................................. 81.63ms DONE
2024_11_21_011625_add_e_invoicing_logs_table ....................................................................................... 137.32ms DONE
2024_11_28_054808_add_referral_earning_column_to_users_table ........................................................................ 85.54ms DONE
2024_12_18_023826_2024_12_18_enforce_tax_data_model .................................................................................. 3.01ms DONE
2025_01_08_024611_2025_01_07_design_updates .......................................................................................... 4.50ms DONE
2025_01_15_222249_2025_01_16_zim_currency_change ..................................................................................... 1.71ms DONE
2025_01_18_012550_2025_01_16_wst_currency ............................................................................................ 7.71ms DONE
2025_01_22_013047_2025_01_22_add_verification_setting_to_gocardless ................................................................. 56.08ms DONE
2025_02_12_000757_change_inr_currency_symbol ......................................................................................... 0.47ms DONE
2025_02_12_035916_create_sync_column_for_payments .................................................................................. 107.22ms DONE
2025_02_16_213917_add_e_invoice_column_to_recurring_invoices_table ................................................................. ...


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/10709 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 1/11/2026 **Status:** ✅ Merged **Merged:** 1/11/2026 **Merged by:** [@MickLesk](https://github.com/MickLesk) **Base:** `main` ← **Head:** `copilot/fix-invoice-ninja-error-500` --- ### 📝 Commits (2) - [`e4ddf76`](https://github.com/community-scripts/ProxmoxVE/commit/e4ddf760b755b159576fd2eb9a198e282630fc44) Initial plan - [`634e83a`](https://github.com/community-scripts/ProxmoxVE/commit/634e83a6bc4df90ac49c5d541f078c416f528d9b) Fix Invoice Ninja Error 500 by ensuring proper file ownership after artisan commands ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `install/invoiceninja-install.sh` (+1 -0) </details> ### 📄 Description ## ✍️ Description Invoice Ninja setup fails with Error 500 after database initialization. Artisan commands (`migrate`, `db:seed`, `optimize`) run as root and modify file ownership, breaking web server access. **Change:** Added `chown -R www-data:www-data /opt/invoiceninja` after database setup completes. ```bash $STD php artisan optimize chown -R www-data:www-data /opt/invoiceninja # ← ensures www-data owns all files msg_ok "Set up Database" ``` Initial ownership (lines 88-90) is set before artisan commands run. This restoration ensures nginx can serve the application. ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [x] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [ ] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> ---- *This section details on the original issue you should resolve* <issue_title>Invoice ninja Error 500</issue_title> <issue_description>### ✅ Have you read and understood the above guidelines? yes ### 🔎 Did you run the script with verbose mode enabled? Yes, verbose mode was enabled and the output is included below ### 📜 What is the name of the script you are using? Invoice ninja ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/invoiceninja.sh)" ### ⚙️ What settings are you using? - [ ] Default Settings - [x] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 13 ### 📈 Which Proxmox version are you on? 9.1.1 ### 📝 Provide a clear and concise description of the issue. The script runs Install works Setuping the database works Setuping the app returns error 500 ### 🔄 Steps to reproduce the issue. Run the script Open the page for setup enter the database creds enter your username email and password enter then error 500 if available try the custom domain name ### ❌ Paste the full error output (if available). Processing triggers for php8.4-fpm (8.4.16-1+0~20251218.39+debian13~1.gbp6f1a69) ... ✔️ Setup PHP 8.4 ✔️ Deployed: invoiceninja (5.12.41) ✔️ Configured InvoiceNinja ⏳ Downloading Chromium for PDF GenerationStarting download. Ungoogled Chrome Extracting Archive extracted. Completed! ungoogled currently in use. ✔️ Downloaded Chromium for PDF Generation ⏳ Setting up Database INFO Configuration cache cleared successfully. INFO Application cache cleared successfully. INFO Route cache cleared successfully. INFO Compiled views cleared successfully. INFO Preparing database. Creating migration table ............................................................................................................ 52.30ms DONE INFO Loading stored database schemas. database/schema/mysql-schema.sql ......................................................................................................... 9s DONE INFO Running migrations. 2019_15_12_112000_create_elastic_migrations_table ................................................................................... 55.93ms DONE 2024_10_08_034355_add_account_e_invoice_quota ....................................................................................... 78.18ms DONE 2024_10_09_220533_invoice_gateway_fee ................................................................................................ 1.41ms DONE 2024_10_11_151650_create_e_invoice_tokens_table .................................................................................... 216.78ms DONE 2024_10_11_153311_add_e_invoicing_token .............................................................................................. 1.93ms DONE 2024_10_14_214658_add_routing_id_to_vendors_table ................................................................................... 78.08ms DONE 2024_10_18_211558_updated_currencies ............................................................................................... 128.49ms DONE 2024_11_11_043923_kill_switch_licenses_table ........................................................................................ 81.01ms DONE 2024_11_19_020259_add_entity_set_to_licenses_table .................................................................................. 81.63ms DONE 2024_11_21_011625_add_e_invoicing_logs_table ....................................................................................... 137.32ms DONE 2024_11_28_054808_add_referral_earning_column_to_users_table ........................................................................ 85.54ms DONE 2024_12_18_023826_2024_12_18_enforce_tax_data_model .................................................................................. 3.01ms DONE 2025_01_08_024611_2025_01_07_design_updates .......................................................................................... 4.50ms DONE 2025_01_15_222249_2025_01_16_zim_currency_change ..................................................................................... 1.71ms DONE 2025_01_18_012550_2025_01_16_wst_currency ............................................................................................ 7.71ms DONE 2025_01_22_013047_2025_01_22_add_verification_setting_to_gocardless ................................................................. 56.08ms DONE 2025_02_12_000757_change_inr_currency_symbol ......................................................................................... 0.47ms DONE 2025_02_12_035916_create_sync_column_for_payments .................................................................................. 107.22ms DONE 2025_02_16_213917_add_e_invoice_column_to_recurring_invoices_table ................................................................. ... </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes community-scripts/ProxmoxVE#10446 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 16:34:36 +03:00
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/ProxmoxVE#8937
No description provided.