microsoft / BikeSharing360_BackendServices

BikeSharing360 Demo Apps Backend Services
90 stars 50 forks source link

Readme needs some changes #4

Closed hiraldesai closed 7 years ago

hiraldesai commented 7 years ago

Please make couple of changes to readme file

  1. Add Node.js VS tools as a requirement
  2. After installing Node.js VS tools and before deploying the ARM project - make sure you right click npm inside BikeSharing.Services.Rides.njsproj and click Install missing npm Packages. If you don't do this - the node_modules folder on the deployed web app will be empty and "rides" API will throw 500 errors (and the mobile app will throw "Communication error"). image
  3. Make sure you don't clone the repository too far down the nested directory structure on your local machine (preferably just in the root of your c:\ or d:). I saw some errors with deployment about long file paths for some of the files. I'm not 100% sure if it completely fails to deploy or partially in this instance but keeping.
  4. For some reason, my deployment returned "failed" - although there was not a single error message in the whole log output. Not sure what was happening there.
    22:51:06 - Deploying template using PowerShell script failed.
    22:51:06 - Tell us about your experience at https://go.microsoft.com/fwlink/?LinkId=691202
eiximenis commented 7 years ago

Thanks @hiraldesai! I'll update the readme.md witth your suggestions.

About the issues of long paths for some files in mode_modules, this could happen if using the version of nodejs that is shipped with VS, which is quite old and still uses npm 2. Installing a newer version of node with npm 3 (which flattens the node_modules folder) and instructing VS to use this newer version, should solve most of the issues. I'll add info about this process in the readme.md also.

Thanks!

kaby76 commented 7 years ago

I'm having a similar problem. I'm on latest of Node.JS. Further, in the log, I get:

13:15:18 - [ERROR] Copy-Item : The specified path, file name, or both are too long. The fully 13:15:18 - [ERROR] qualified file name must be less than 260 characters, and the directory name 13:15:18 - [ERROR] must be less than 248 characters. 13:15:18 - [ERROR] At C:\Users\Ken\Documents\BikeSharing360_BackendServices\src\BikeSharing.Servic 13:15:18 - [ERROR] es.Deploy\bin\Debug\staging\BikeSharing.Services.Deploy\Deploy-AzureResourceGro 13:15:18 - [ERROR] up.ps1:183 char:3 13:15:18 - [ERROR] + Copy-Item "$PSScriptRoot............\src\BikeSharing.Se ... 13:15:18 - [ERROR] + ~~~~~~~~~~~~~ 13:15:18 - [ERROR] + CategoryInfo : WriteError: (C:\Users\Ken\Do...s\arcgis_parser:S 13:15:18 - [ERROR] tring) [Copy-Item], PathTooLongException 13:15:18 - [ERROR] + FullyQualifiedErrorId : CreateDirectoryIOError,Microsoft.PowerShell.Comm 13:15:18 - [ERROR] ands.CopyItemCommand 13:15:18 - [ERROR]

Isn't that a Powershell error? Are there requirements for Powershell version? On Windows 10.

hiraldesai commented 7 years ago

Just put the project in the root of your c:\ to get around the problem. I didn't have time to investigate and fix the real issue though. On Fri, Dec 16, 2016 at 10:51 AM Ken Domino notifications@github.com wrote:

I'm having a similar problem. I'm on latest of Node.JS. Further, in the log, I get:

13:15:18 - [ERROR] Copy-Item : The specified path, file name, or both are too long. The fully 13:15:18 - [ERROR] qualified file name must be less than 260 characters, and the directory name 13:15:18 - [ERROR] must be less than 248 characters. 13:15:18 - [ERROR] At C:\Users\Ken\Documents\BikeSharing360_BackendServices\src\BikeSharing.Servic 13:15:18 - [ERROR] es.Deploy\bin\Debug\staging\BikeSharing.Services.Deploy\Deploy-AzureResourceGro 13:15:18 - [ERROR] up.ps1:183 char:3 13:15:18 - [ERROR] + Copy-Item "$PSScriptRoot............\src\BikeSharing.Se ... 13:15:18 - [ERROR] + ~ 13:15:18 - [ERROR] + CategoryInfo : WriteError: (C:\Users\Ken\Do...s\arcgis_parser:S 13:15:18 - [ERROR] tring) [Copy-Item], PathTooLongException 13:15:18 - [ERROR] + FullyQualifiedErrorId : CreateDirectoryIOError,Microsoft.PowerShell.Comm 13:15:18 - [ERROR] ands.CopyItemCommand 13:15:18 - [ERROR]

Isn't that a Powershell error? Are there requirements for Powershell version? On Windows 10.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BikeSharing360_BackendServices/issues/4#issuecomment-267667895, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9WdgCkWpP73xGCPIicBJZKxxu1pj10ks5rIt2sgaJpZM4LO6Zo .

-- Kind Regards, Hiral

kaby76 commented 7 years ago

Thank you for responding. Seems like I'm working in the dark.... Yes, moving the directories around to c:/ seems to take care of that problem. Deployment is "successful". But, how do I test the servers? How do I know even if any/all of the four servers are up? I'm using the Android app, but there should be a script which pokes them.

hiraldesai commented 7 years ago

I deployed the APIs and then directly ran the mobile app (iOS) in debug mode on emulator - the APIs just worked. Don't forget to run the SQL scripts on the databases. The rides-data (500 MB one) takes a long time. Are you saying that APIs need to have a diagnostics end point to check if they're working? My main purpose to go through all this was to look at the app and see the underlying code to get ideas I can use in my own project. It's a nice app to demonstrate the capabilities of Xamarin Forms, I'm really impressed so far.

kaby76 commented 7 years ago

That's exactly what I want to do: look at the Xamarin Forms app. The code is much better organized than previous apps I've seen by these guys. But, the app throws an error at login. The app sends a http login request, but the server returns 403, which is turns into a throw in the app, can't login. I don't know what the server is doing, and really don't want to debug that too, but that's what seems has to be done. Is there a login id, password I can use that's set up? I thought it builds the dbs with the deploy. It took 30 minutes or more to do that deploy. Is there another step I'm missing? I'll check the dbs. Thanks!

eiximenis commented 7 years ago

Hi @kaby76 All APIs (except rides one because is written in node) have Swagger enabled. So, if you go ho http://your-profiles-api-server.azurewebsites.net/swagger/ui the swagger page should appear and you should be able to test the API methods.

The deploy just deploy the schema but no data, so if you did not run the SQL files provided, databases will be empty, and no Login/Signup will be possible because no Tenant were configured. Running the SQL files is a manual process that you need to perform after the deployment.

Thanks!

kaby76 commented 7 years ago

Sigh.

Can someone tell me how to initialize the db's with these SQL files? I can connect and set up three of the db's but not the Rides db because it is 1/2 GB, 725,000 lines of SQL text. From VS 2015, I navigate to the Server Explorer | SQL Databases | bikesharing-services-ridesName / right-click -> Open in SQL Server Object Explorer ->SQL Server | bikesharing360asdfsadf.....database.windows.net | bikesharing-services-ridesName / right-click -> New Query, then enter the 725,000 lines of SQL code. The "Query completed with errors", but gives absolutely no output in the Message window. All the other SQL files worked fine. I checked the other db's, and they appear OK.

Also, when I set up the Profiles db, the output contains an error:

Msg 8106, Level 16, State 1, Line 192 Table 'dbo.Employees' does not have the identity property. Cannot perform SET operation.

Apparently, SET IDENTITY_INSERT [dbo].[Employees] ON GO is not accepted.

For what it's worth, I can at least get the Android app to connect (userid=scottgu pw=InTotalPain).

hiraldesai commented 7 years ago

The smaller files you can run straight from SSMS. For the big file - just unzip it in the same folder and run this command in command prompt.

sqlcmd -S "your-database-id.database.windows.net" -d "bikesharing-services-rides-your-database-name" -U "your-user-name@your-database-id" -P "your-database-password" -i "C:\your-path-to-repo\BikeSharing360_BackendServices\src\sql\rides-data.sql"
robhellest commented 7 years ago

Issue resolved: During an attempt to deploy BikeSharing.Services.Deploy project to Azure - an error is received : Deploy-AzureResourceGroup.ps1 is not digitally signed. You cannot run this script on the current system.

Any insight, guidance is appreciated;