Closed jbelien closed 6 years ago
I haven't tried to use apache, only a standalone service running behind NGINX. Any logging available on this?
No, not really. It's not linked to Apache (could be NGINX), just on creating a service that runs the API.
EDIT: it is the standalone service that I didn't succeed to start.
The working directory maybe, where is your data directory? That's where your working directory should be.
Nope, apparently not. I fixed the path for WorkingDirectory
but didn't work either.
Here is the log :
Sep 15 14:28:04 routing-api systemd[1]: routing-api.service: Main process exited, code=exited, status=140/n/a
Sep 15 14:28:04 routing-api systemd[1]: routing-api.service: Unit entered failed state.
Sep 15 14:28:04 routing-api systemd[1]: routing-api.service: Failed with result 'exit-code'.
Sep 15 14:28:14 routing-api systemd[1]: routing-api.service: Service hold-off time over, scheduling restart.
Sep 15 14:28:14 routing-api systemd[1]: Stopped Routing .NET Web API Application running on Debian.
Sep 15 14:28:14 routing-api systemd[1]: Started Routing .NET Web API Application running on Debian.
Sep 15 14:28:14 routing-api dotnet-routing-api[25973]: Error:
Sep 15 14:28:14 routing-api dotnet-routing-api[25973]: An assembly specified in the application dependencies manifest (Itinero.API.deps.json) was no
t found:
Sep 15 14:28:14 routing-api dotnet-routing-api[25973]: package: 'Microsoft.AspNetCore.Diagnostics.Abstractions', version: '1.0.2'
Sep 15 14:28:14 routing-api dotnet-routing-api[25973]: path: 'lib/netstandard1.0/Microsoft.AspNetCore.Diagnostics.Abstractions.dll'
Try deleting the output folder and rebuilding. Does the process run when you start it manually?
Yes, everything works when I run ./run.sh
manually !
It's just an issue with the creation (and start) of the service.
No better luck with trying to do so on Ubuntu 16.04
I tried to use Supervisor according to https://developingsoftware.com/aspnetcore-ubuntu/
The application seems to work : I can display http://localhost:5000/ (without running ./run.sh
) but no instance is loaded ...
Any idea ?
The only reason I can think of for it not loading the data is again an issue with the paths, it either can't find the settings file or the data directory.
Any logging you can see? Perpaps I can improve the code to log some basics to the console when it starts, like paths, settings file loaded and stuff like that?
Also, I can try the Supervisor thing myself, can you give me your configuration file?
Does not seem to have any error message when I'm trying to start the service on Ubuntu 16.04. On Debian 9, I had this error message :
Sep 15 14:28:14 routing-api dotnet-routing-api[25973]: Error:
Sep 15 14:28:14 routing-api dotnet-routing-api[25973]: An assembly specified in the application dependencies manifest (Itinero.API.deps.json) was no
t found:
Sep 15 14:28:14 routing-api dotnet-routing-api[25973]: package: 'Microsoft.AspNetCore.Diagnostics.Abstractions', version: '1.0.2'
Sep 15 14:28:14 routing-api dotnet-routing-api[25973]: path: 'lib/netstandard1.0/Microsoft.AspNetCore.Diagnostics.Abstractions.dll'
For Supervisor, here is my configuration file :
[group:routing]
programs=routing
[program:routing]
directory=/home/ubuntu/routing-api/src/Itinero.API/bin/Debug/netcoreapp2.0
command=/usr/bin/dotnet Itinero.API.dll
autostart=true
autorestart=true
stderr_logfile=/var/log/routing.err.log
stdout_logfile=/var/log/routing.out.log
user=ubuntu
stopsignal=INT
stopasgroup=true
How do you do to make your API run (as a daemon) even when you're not connected ?
Ah I see what's wrong now I think. I got the supervisor thing running by first trying to get the 'command' part to run. You need to be in the same directory as the appsettings.json file:
[group:hellomvc]
programs=hellomvcapp
[program:hellomvcapp]
directory=/home/xivk/work/itinero/routing-api/src/Itinero.API/
command=/usr/bin/dotnet ./bin/Debug/netcoreapp2.0/Itinero.API.dll
autostart=true
autorestart=true
stderr_logfile=/var/log/hellomvc.err.log
stdout_logfile=/var/log/hellomvc.out.log
user=xivk
stopsignal=INT
stopasgroup=true
Your setup might also work when you mode the appsettings.json file into the output folder:
/home/ubuntu/routing-api/src/Itinero.API/bin/Debug/netcoreapp2.0
I use docker so it's a bit different in the way I setup all this.
Yes ! It works \o/
[group:routing]
programs=routing
[program:routing]
directory=/home/ubuntu/routing-api/src/Itinero.API
command=/usr/bin/dotnet ./bin/Debug/netcoreapp2.0/Itinero.API.dll
autostart=true
autorestart=true
stderr_logfile=/var/log/routing.err.log
stdout_logfile=/var/log/routing.out.log
user=ubuntu
stopsignal=INT
stopasgroup=true
👍 👍 👍
Yay! 🥇 👍
Thanks a lot ! :)
Hi :) Thanks so much! In my case i had to change ExecStart from home/pi/Repos/myWebApp/bin/Development/netcoreapp2.2/linux-arm/myWebApp.dll to home/pi/Repos/myWebApp/bin/Development/netcoreapp2.2/linux-arm/publish/myWebApp.dll and it'running.
Hello,
I followed those steps to run the API behind Apache : https://docs.microsoft.com/en-us/aspnet/core/publishing/apache-proxy
No problem at all to configure Apache (even though I didn't follow the guide at all) ! But I can't manage to create a service that starts :P
Here is my
routing-api.service
file ; what did I miss ?