Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Get Rides for User #13

Closed
SunnyMukherjee opened this issue Feb 20, 2017 · 2 comments
Closed

Unable to Get Rides for User #13

SunnyMukherjee opened this issue Feb 20, 2017 · 2 comments

Comments

@SunnyMukherjee
Copy link

SunnyMukherjee commented Feb 20, 2017

Hello,

I hope someone can give me a clue about why the Rides service is not returning any data.

Here is what I have already done successfully:

  • Deployed the BikeSharing.Services.Deploy project
  • Ran the SQL scripts and loaded the data in all the databases

Here is what I am seeing.

  • I log in as Username: "scottgu" and Password: "password".
  • I click on Rides.
  • I get an "Error: Communication Error" dialog box.
  • I log into Azure. I check my App Service is running.
  • I put a breakpoint in the RidesService -> GetUserRides() function.
  • I verified "scottgu" is UserId 1 in the Users table.

Id LastLogin UserName Password TenantId
1 0001-01-01 00:00:00.0000000 scottgu NULL 1

  • I verified the Rides table has data for UserId 1.

SELECT TOP (1000) [Id] ,[Duration] ,[Start] ,[Stop] ,[StartStationId] ,[EndStationId] ,[BikeId] ,[UserId] ,[EventType] ,[EventId] ,[GeoDistance] ,[EventName] FROM [dbo].[rides] where UserId = 1

  • My URI string is the following:
    http://bikesharing-services-XXXX.azurewebsites.net:80/api/rides/user/1
    (Ignore the XXXX because I am not showing the entire URL on here.)

  • I either connect to the above URL either with Swagger, PostMan, or in the code. I found Swagger is not available for this project since it was written in Node. But PostMan and my code give the same response.

  • I get the following error:
    "The page cannot be displayed because an internal server error has occurred."

  • I verified I get the same error from 2 different machines.

What am I missing? I followed all the steps in the ReadMe.MD file for the BikeSharing360_BackendServices project.

Do I need to configure or enable something in Azure?

Thank you

@eiximenis
Copy link
Contributor

Hi!
Please enable application logs on Azure Portal for this website. Select the AppService, go to "Monitoring" -> Diagnostics logs & Enable Application Logging (filesystem) and Level "verbose".
Then restart the AppService

Now you can go to MONITORING -> Log Stream and you'll see the log of the AppService.
Connect using mobile app or postman and hopefully you'll see the error in the Log Stream.

Thx!

@SunnyMukherjee
Copy link
Author

Thank you for the tip! That tip helped me track down what else I needed to configure to get the My Rides section of the app to show data.

Here is the screenshot of my working app in the simulator:

image

So what was the error? I found out that the "restify" package was not installed during the deployment. I googled around and found out that I needed to run "npm install" manually to install the packages. I may not have had Visual Studio configured correctly with NodeJS and NPM to install the packages in the Rides project before deployment. So I had to do it manually.

Here are the extra manual steps in case anyone else runs into the same problem.

  1. Open the BikeSharing.Services.Deploy.sln.
  2. Go to BikeSharing.Services.Rides project.
  3. Open the package.json.
  4. Edit the version so it looks like the following: "version": "1.0.0". Otherwise, the NPM command will not run properly.
  5. Open the same project in Windows Explorer.
  6. Open a command-line prompt.
  7. Run "npm install".
  8. Return to the project in Visual Studio. You should see the npm folder in the Rides project populated with the installed packages. Right click on the Rides project and republish it.
  9. Go to the Rides App Service in Azure.
  10. Go to Monitoring -> Diagnostic Logs -> Enable Application Logging -> Level: Verbose.
  11. Restart the App Service.
  12. Start PostMan or start the app.
  13. You should see data in the My Rides section.
  14. Go to Log Stream. You should see the SQL queries that get run.

I hope this helps. Maybe the administrators of this project should create a troubleshooting section and add such steps in the ReadMe file.

Thank you

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

No branches or pull requests

2 participants