On a self-hosted instance, start with the logs. Most problems leave a clear message in one of them.
# Container startup, scheduler, and queue worker output
docker compose logs -f app
# Application log
docker exec -it investbrain-app tail -f storage/logs/laravel.log
# Database
docker compose logs pgsql
For a quick status check:
docker compose ps
The app container should show healthy after a minute or so.
Installation and startup
"400 Bad Request" or "Oops! An Error Occurred"
Investbrain only answers to the address in APP_URL (and its subdomains). Opening it at any other address shows "Oops! An Error Occurred. The server returned a 400 Bad Request". This most often happens because:
APP_URLis still the defaulthttp://localhost:8000, and you're opening Investbrain from another device at an address likehttp://192.168.1.50:8000.- You moved Investbrain to a new domain and didn't update
APP_URL. - You reach Investbrain by more than one address, such as an IP address and a hostname. Only the one in
APP_URLworks.
To fix it:
- Set
APP_URLto the address you type into the browser, for examplehttp://192.168.1.50:8000orhttps://investbrain.home. SetASSET_URLto the same value if you set it separately. - Apply the change with
docker compose up -d. - If you use a reverse proxy, make sure it forwards the original
Hostheader (see Running behind a reverse proxy). If the proxy sends its own name for the upstream, such asinvestbrain-app, every page returns this error.
The container can still show healthy while you see this error, because its health check calls http://localhost from inside the container. Investbrain always accepts localhost.
This check exists so that password reset links can't be pointed at someone else's server.
"Database is not ready after one minute. Exiting..."
The app container waits up to a minute for PostgreSQL, then gives up. Check the database log with docker compose logs pgsql.
-
password authentication failed for user "investbrain"- the credentials in theappservice don't match the database. PostgreSQL only readsPOSTGRES_USER,POSTGRES_PASSWORD, andPOSTGRES_DBthe first time its volume is created, so changing them later has no effect. Either change theDB_*values back to the originals, or, on a fresh install with no data you need, delete the volume and start again:bashdocker compose down docker volume rm investbrain_investbrain-pgsql # check the exact name with: docker volume ls docker compose up -d -
database files are incompatible with server- thepostgresimage's major version was changed on an existing volume. Switch back to the original version (postgres:15-alpine). See Updating for how to upgrade PostgreSQL safely. -
The database is just slow to start (common on a Raspberry Pi or NAS). Run
docker compose up -dagain once thepgsqlcontainer is up.
"Bind for 0.0.0.0:8000 failed: port is already allocated"
Something else on the host is using that port. Either stop it or change Investbrain's port.
I can't find my APP_KEY
If you didn't set APP_KEY, one was generated on first start and saved to storage/app/.key in the storage volume. To see it:
docker exec -it investbrain-app cat storage/app/.key
Keep a copy somewhere safe. If you ever move to an env file, copy this value into APP_KEY so it doesn't change.
"The MAC is invalid" or "The payload is invalid" errors
The encryption key changed after data was created. This happens if APP_KEY was edited, or the storage volume holding the generated key was deleted while the database was kept. Restore the original key (from a backup of storage/app/.key or your old configuration).
If the original key is gone for good, clear the browser cookies for the site and sign in again. Users who had two-factor authentication turned on will need it reset, and API tokens and MCP connections should be recreated.
Permission denied errors in the log
The container fixes permissions on storage every time it starts, so a restart usually resolves this. If you use a bind mount on a host with SELinux (Fedora, RHEL, and similar), add :z to the mount so the container can write to it:
- /path/to/storage:/var/app/storage:z
Configuration
My configuration changes aren't taking effect
Run docker compose up -d after editing docker-compose.yml or your env file. docker compose restart keeps the old environment. See Applying configuration changes.
Also make sure you're using either the environment block or an env file, not both. If you have both, check which one actually contains the value you changed.
Styling is broken and images are huge
The page is loading without its CSS, usually because the browser can't fetch the assets from the address Investbrain is generating. This typically happens when you reach Investbrain through a domain name or a reverse proxy.
- Set
ASSET_URL(andAPP_URL) to the exact address you type into the browser, includinghttps://and any port. - If you use HTTPS through a proxy, make sure the proxy sends
X-Forwarded-Proto: https. Without it, Investbrain generateshttp://asset links, and the browser blocks them as mixed content. - Check the browser's developer console for the URL that failed to load. It tells you which address Investbrain thinks it's on.
Links point to http:// even though I use HTTPS (or the other way around)
Investbrain decides between http:// and https:// from the X-Forwarded-Proto header your proxy sends.
- If links are
http://behind an HTTPS proxy, addX-Forwarded-Proto: httpsto your proxy configuration (see Running behind a reverse proxy). - If links are
https://but you serve plain HTTP, make sure nothing in front of Investbrain setsX-Forwarded-Proto. Any value of that header, evenhttp, makes Investbrain treat the request as secure.
Registering is disabled and I can't create the first account
REGISTRATION_ENABLED is false. Set it to true, apply the change, register, and then turn it off again.
Market data
Market data doesn't load on a fresh install
The default provider, Yahoo Finance, is often blocked by ad blockers and DNS filters. Pi-hole, AdGuard Home, and similar tools commonly block fc.yahoo.com, which Investbrain needs. Allow-list fc.yahoo.com (and if needed query1.finance.yahoo.com and query2.finance.yahoo.com) and data should begin populating.
To confirm the container can reach the internet at all:
docker exec -it investbrain-app php artisan refresh:market-data --force
The output lists each symbol and any error.
"The symbol provided (XYZ) is not valid"
Your market data provider doesn't recognize the symbol. Check the format your provider expects. Exchange suffixes vary: for example, Yahoo Finance uses VOD.L for London and SHOP.TO for Toronto. Symbols that work with one provider may not work with another.
Prices aren't updating
- Prices refresh on weekdays only, and a symbol is only refreshed once its price is older than
MARKET_DATA_REFRESHminutes (30 by default). - Only symbols with open positions (quantity above zero) are refreshed automatically.
- Check Provider Health for failures or rate limiting. Free tiers of Alpha Vantage, Finnhub, and Twelve Data have low limits; add a fallback provider to spread the load.
- Check that the scheduler is running:
docker compose logs appshould show scheduled commands running every minute.
The performance chart is empty or has gaps
-
Snapshots are taken on weekdays at
DAILY_CHANGE_TIME. A brand new portfolio won't have a chart line until its history has been built. -
Adding or editing a past-dated transaction rebuilds that portfolio's history automatically, but it relies on the market data provider for historical prices. If the provider failed at the time, gaps can remain.
-
Rebuild a portfolio's history manually:
bashdocker exec -it investbrain-app php artisan sync:daily-change <portfolio_id> --forceFind the portfolio ID in the address bar (
/portfolio/<id>). This is resource intensive for portfolios with long histories.
Dividends or splits are missing
Dividend data refreshes Monday, Wednesday, and Friday, and split data weekly. To refresh immediately:
docker exec -it investbrain-app php artisan refresh:dividend-data --force
docker exec -it investbrain-app php artisan refresh:split-data --force
Not every provider supplies dividend and split history. Yahoo Finance does.
Holding totals look wrong
Recalculate holdings from their transactions:
docker exec -it investbrain-app php artisan sync:holdings
If realized gains on sales look off (for example after importing old data), recalculate the cost basis of sales:
docker exec -it investbrain-app php artisan fix:cost-basis-for-sales --portfolio=<portfolio_id>
Accounts and email
Password reset, invitation, or verification emails never arrive
On a self-hosted instance, MAIL_MAILER is log by default, so emails are written to the log instead of being sent. In a pinch you can find the link at the end of the log right after triggering the email:
docker exec -it investbrain-app tail -n 150 storage/logs/laravel.log
The link may be wrapped across lines with = characters at the line ends; remove those (and any =3D, which stands for =) before pasting it into your browser.
To send real email, configure SMTP. If you've configured SMTP and email still doesn't arrive, look for mail errors in storage/logs/laravel.log and check your spam folder.
Locked out by two-factor authentication
First try one of your recovery codes on the 2FA prompt. If you've lost those too, turn off 2FA for the account directly in the database:
docker exec -it investbrain-pgsql psql -U investbrain -d investbrain -c \
"UPDATE users SET two_factor_secret = NULL, two_factor_recovery_codes = NULL, two_factor_confirmed_at = NULL WHERE email = 'you@example.com';"
The user can then sign in with just their password and set up 2FA again.
Forgot your password and email doesn't work
On a self-hosted instance, reset the password from the command line:
docker exec -it investbrain-app php artisan tinker --execute \
'App\Models\User::where("email", "you@example.com")->first()->forceFill(["password" => Hash::make("a-new-strong-password")])->save();'
Sign in with the new password and change it from Manage Profile right away.
"Too many login attempts"
Logins are limited to five attempts per minute for each email and IP address. Wait a minute and try again.
Social login fails with "redirect_uri mismatch" or "Could not login using ..."
- The callback URL registered with the provider must be exactly
https://<your-host>/auth/<provider>/callback(github,google,facebook,linkedin-openid, oroidc), including the scheme and port. - Check that the client ID and secret are correct and that the provider is listed in
ENABLED_LOGIN_PROVIDERS. - For OpenID Connect, check
storage/logs/laravel.log, and see Single Sign-On troubleshooting for the common causes. - If a user sees Your ... account didn't share an email address, the provider didn't send one. For OpenID Connect, make sure the client is allowed the
emailscope and the user has an email address set in the provider. - If a user sees You don't have an account yet, and automatic account provisioning is not enabled, nobody has an Investbrain account with that email and
SSO_AUTO_PROVISIONisfalse. Create the account first (or let them register), or setSSO_AUTO_PROVISION: true. - If a user sees Account already exists. Check your email..., an account with that email already exists. They need to click the link in the verification email (so email must be working), or sign in with their password and connect the provider from Connections instead.
Import and export
My import failed
When an import fails, nothing is saved. The import page lists every problem with its sheet, row, column, and value, so fix them all in your spreadsheet and upload it again. Common problems:
- The file isn't
.xlsxor is larger than 2 MB. Save it as an Excel workbook, or split it into several smaller files. - "No data found. Check the sheet names and headings." None of the sheets is named Portfolios, Transactions, Daily Changes, or Config, or they have no rows. Using Download import template is the easiest way to get the names and headings right.
- "The Transactions sheet is missing the ... column." A required heading is missing or misspelled. Compare the heading row with the Transactions sheet columns.
- "No portfolio with this ID was found in the Portfolios sheet or in your account." The Portfolio ID doesn't match any portfolio, often because a title was entered instead of an ID. See Referring to portfolios.
- "You do not have access to that portfolio." The portfolio, or the existing transaction a row updates, belongs to a portfolio you don't have full access to.
- "Could not find symbol." Your market data provider doesn't recognize the symbol. Check its spelling and exchange suffix (for example
VOD.L), and see Market data doesn't load if every symbol fails. - "You cannot sell ... because only ... are held in that portfolio on that date." A sale is larger than the shares held on its date. Check the sale's date and quantity, and that the purchases before it are in the file or already in your account.
- A value isn't accepted, such as a date in the future, a thousands separator in a price (
1,000), or a Quantity of zero. See the formatting tips. - "Hang on! You're doing that too much." You can start three imports per minute. Wait and try again.
The import finished but totals and charts are empty
After an import, Investbrain refreshes dividends, recalculates holdings, and rebuilds each portfolio's history in the background. On a large import this can take a while. On a self-hosted instance, watch progress with docker compose logs -f app. If nothing happens, make sure the queue workers are running (they appear in the log as queue-worker processes).
My export is stuck on "Preparing your export"
Exports are built in the background. A large account can take a few minutes, and you can leave the page in the meantime. On a self-hosted instance, an export that never finishes usually means the queue workers aren't running; check docker compose logs -f app for queue-worker processes and errors.
My export failed, or the download link stopped working
- "Something went wrong while preparing your export." Click Try again. On a self-hosted instance, the reason is in
storage/logs/laravel.log. - The download link returns "Not Found". Exports can be downloaded for 24 hours, and generating a new export replaces the previous one. Generate a new export and download that.
API
401 Unauthorized
- Check the header is exactly
Authorization: Bearer <token>. - The token may have been deleted on the API Tokens page, or have expired. Create a new one.
- If the OAuth keys in
storagewere regenerated (for example the storage volume was recreated), every existing token is invalid. Create new tokens.
I get an HTML page instead of JSON
Add Accept: application/json to your request. Without it, some errors (like an invalid token) return a redirect to the login page instead of a JSON error.
403 Forbidden
You have read-only access to that portfolio, or no access at all. Changes require full access.
422 "The filter field may only contain..." or "The sort field may only contain..."
You used a filter or sort column that isn't supported for that endpoint. The error message lists the allowed values. See Pagination, sorting, filtering, and search.
MCP clients can't connect
-
404 Not Foundfrom/mcp(or from the/.well-known/oauth-...discovery URLs) means the MCP server is turned off. SetMCP_SERVER_ENABLEDtotrueand apply the change. See Turning off the MCP server. -
Hosted assistants (Claude, ChatGPT) need your instance on the public internet over HTTPS with a valid certificate. A
localhostor LAN address only works for assistants running on your own machine. -
Check the OAuth metadata from outside your network:
bashcurl https://investbrain.example.com/.well-known/oauth-authorization-serverEvery URL in the response should start with your public HTTPS address. If they show
http://, an internal hostname, or the wrong port, fixAPP_URLand your proxy'sHostandX-Forwarded-Protoheaders. -
403 Forbiddenmeans the client sent a token without themcp:usescope, usually a personal API token pasted into the client. Remove it and let the client sign in with OAuth. -
It worked before and now doesn't - access may have been revoked under Connections > Authorized Apps, or the OAuth keys in
storagewere regenerated. Reconnect the assistant.
See the MCP guide for setup steps.
AI chat
The AI chat window doesn't appear
Set AI_CHAT_ENABLED: true and apply the change. The window only appears on portfolio and holding pages, not the dashboard.
The assistant returns errors
- Check that
CHAT_PROVIDERmatches the API key you set (for exampleanthropicwithANTHROPIC_API_KEY), and that the key is valid and has credit. - If you set
CHAT_MODEL, make sure it's a model your provider offers. - For Ollama,
OLLAMA_BASE_URLmust be reachable from inside the container.http://localhost:11434points at the container itself. See AI chat for alternatives. - The error details are in
storage/logs/laravel.log.
Still stuck?
Search the GitHub issues or open a new one. Include:
- What you were doing and what happened
- The relevant lines from
docker compose logs appandstorage/logs/laravel.log(remove any secrets) - The Investbrain version shown at the top of the startup log
- How you're running it (Docker Compose, reverse proxy, host OS)