# Troubleshooting nopCommerce

nopCommerce runs as a .NET service behind nginx. Most problems fall into one of three categories: the application service is not running, Nginx cannot reach it (502), or it cannot connect to SQL Server. This page shows where the logs are and how to work through the common failures.

## Where to find the logs

nopCommerce is a managed systemd **user** service, so its console output goes to the journal rather than a flat file. Combine the journal with Nginx logs and the application's own logging.

| Component | Where |
| --- | --- |
| Application (.NET) | `journalctl --user -u application.service` (or `<app_name>-application.service`) - startup errors, crashes, stack traces |
| Service status | `systemctl --user status application.service` |
| Nginx access/error | The host's web server logs (Health tab, or under `/var/log/nginx/`) - proxy and 502 errors |
| nopCommerce log | **Admin > System > Log** (stored in SQL Server); plugin/runtime files under the app's `App_Data/Logs/` |
| Database connection | `App_Data/dataSettings.json` in the application directory (connection string, provider) |
| Environment | `conf/.env` in the app root (runtime environment variables) |

Also check the host's [Health](../../platform/hosts/health.md) tab for CPU/memory/disk and service state, and recent deploys in [History](../../platform/hosts/revisions.md).

> [!TIP]
> Add `-f` to the journal command (`journalctl --user -u application.service -f`) to watch logs live while you reproduce a problem or restart the service.

## Common issues

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| Site down, Nginx returns 502 | The .NET application service is not running or not listening | `systemctl --user status application.service`; start/restart it and read the journal for the startup error |
| Service won't start, "framework not found" | `dotnet_version` does not match the build's target framework | Pin the correct `dotnet_version` and re-publish ([Publishing](../../platform/hosts/publishing.md)) |
| "Cannot connect to database" / install screen reappears | Wrong or missing `App_Data/dataSettings.json`, SQL Server down, or bad credentials | Verify `dataSettings.json`, confirm the SQL Server service is reachable, and check the connection string |
| Plugins or theme changes don't appear | Plugins need to recompile and the app must reload | Restart the service so plugins compile against the runtime; clear the plugin cache if needed |
| Errors writing config/logs, install fails | `App_Data/` is not writable by the system user | Fix ownership/permissions on `App_Data/` so the system user can write |
| Scheduled tasks not running (emails stuck) | App not reachable or the task is disabled | Keep the service up; review and enable tasks in **Admin > System > Schedule Tasks** |
| Wrong scheme in links / HTTPS redirect loop | Forwarded headers not honored | The vhost forwards `X-Forwarded-Proto` and the service sets `ASPNETCORE_FORWARDEDHEADERS_ENABLED=true`; re-publish if the vhost was edited by hand |

## A troubleshooting workflow

1. **Check [Health](../../platform/hosts/health.md)** - confirm the host is up and the application service is running, and look for CPU/memory/disk pressure.
2. **Read the relevant log** - start with `journalctl --user -u application.service` for a 502 or a crash. Check the Nginx error log if the journal shows the app is healthy. Check **Admin > System > Log** for application-level errors.
3. **Check the last deploy in [History](../../platform/hosts/revisions.md)** - if a recent change broke the store, revert and re-publish from [Publishing](../../platform/hosts/publishing.md).
4. **Verify services are running** - confirm the nopCommerce service is active (`systemctl --user status application.service`), Nginx is up, and SQL Server is reachable. Restart any service that is down.

## Getting help

If you are still stuck, see the general [platform troubleshooting](../../platform/troubleshooting.md) guide or contact [Support](../../platform/support.md) with the relevant journal and Nginx log excerpts.

## Related

- [Deploy nopCommerce](deploy.md)
- [nopCommerce best practices](best-practices.md)
- [Health](../../platform/hosts/health.md)
- [Support](../../platform/support.md)
