How to see Parse Server cloud code logs? - parse-platform

I have Bitnami's Parse Server set up on Azure.
I'm logging some info from cloud code using console.log and console.error. When using hosted Parse these logs were displayed in the Info & Error Logs section on the Dashboard. Any idea where the logs go to now?
The issue is not specific to Bitnami's distribution. I also tested on a local machine with parse-server-example & Parse Dashboard and got the same result (no logs).

I use AWS but you can see the logs by downloading them or running it on localhost just cd into your folder then do Npm start on terminal and switch you parse server URL to http://localhost:1337/parse.

You can manually download them through the azure cli
Take a look here for installation : https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/
I used npm : npm install azure-cli -g
open up terminal and type in : azure site log download webappname
This will save the logs for the web app named 'webappname' to a file named diagnostics.zip in the current directory.
Unzip and open the folder diagnostics -> LogFiles -> Application
The text file with -stderr- in the name of it will display the logs you display by using console.error() in your cloud code.
The text file with -stdout- in the name of it will display the logs you display by using console.log() in your cloud code.

This is a known issue on Bitnami Parse. We are working on fixing it for the next release.
You have to log in your server via SSH and modify the line below at the /opt/bitnami/apps/parse/htdocs/server.js file:
From:
cloud: "./node_modules/parse-server/lib/cloud-code/Parse.Cloud.js",
To:
cloud: "./cloud/main.js",
You have to include the path to the ./cloud/main.js you previously created (assuming you created it in /opt/bitnami/apps/parse/htdocs/).
Remember to restart the Server after applying those changes running:
sudo /opt/bitnami/ctlscript.sh restart

Related

set email verification on bitnami Parse server from android studio

I have been searching day and night for a way to set email verification for my app with its server on Bitnami Parse Server(EC2). To no avail! All I could find was a client asking me to shift my app to back4App. But to switch my app to back4App only because I have no solution to email verification is ridiculous which is why i am stalling. Help Please!
I am looking for a tutorial or some detailed guide. I am not at all sure on how to download parse server mailgun.
Did you enable HTTPS? Could you check this post? It might help you setting it up:
https://community.bitnami.com/t/parse-email-verification-issue/53354/
Access your server via Putty.
In the terminal go to directory htdocs by using command
$cd /opt/bitnami/apps/parse/htdocs.
Here you will find one file package.json.
Open the file using vi and see whether it contains something or not
If it is empty then add {} to your package.json file
save it and run
$npm install #parse/simple-mailgun-adapter --save
After this open your server.js file set up your emailAdapter with appName and publicserverurl.
After this add this line to your server.js file
verifyUserEmails: true

Google cloud app engine - How to edit code using SSH and debug-mode

I am trying to debug an application I have deployed to google cloud app engine. Reading the docs, I figured out that in order to do so I have to enter the debug mode using
gcloud app --project [Project ID] instances enable-debug
afterwards I am able to SSH into my instance and access root. Now I would like to edit some of the files. However, trying to use vim or nano does not seem to work.
Is there a way to edit those files without re-deploying the entire app?
Once you SSH into the App Engine instance and open a shell into the Docker container, you'll need to download the package list before installing nano or vim:
apt-get update && apt-get install nano
Then you can edit your app's files (which are in /app):
nano composer.json
The deployed app runs live code. It is not generally feasible to edit it. Moreover, changes made to the running container are not permanent; in fact they and are lost at the first re-start.
You may find some information on the Debugging an Instance page.
Unrelated to the above, an actual command-line editor is offered in the cloud shell.

Change the web access log location for SonarQube?

Is it possible to change the web access log location for SonarQube (version 5.6.2) ?
I think we can enable/disable the web access logging and change the log pattern using the sonar.properties file but I couldn't find a way to change the access log filename. Actually all I want is to send the access logs to stdout in my SonarQube docker container.
Came across a mention of a sonar.path.logs property on: http://www.jouvinio.net/wiki/index.php/Configuration_Logs_SonarQube
Added this option to conf/sonar.properties and it worked successfully after sonar restart.
sonar.path.logs=/var/log/sonarqube
[root#azsu-s-bi01sq1 failover]# ls -a /var/log/sonarqube/
. .. access.log ce.log es.log sonar.log web.log

YAML exception: unacceptable character '' (0x0)

This error appears on Elastic Beanstalk after uploading (with a zip) a new version to Elastic Beanstalk! with a file .ebextensions/singlehttps.config that sets the https for a single instance server.
If you're doing the Amazon AWS workshop LAB:
https://github.com/awslabs/eb-node-express-signup
ie. Upload and Deploying your Elastic Beanstalk app
and getting this PROBLEM error:
*ERROR Failed to deploy application.
*ERROR The configuration file __MACOSX/.ebextensions/._setup.config in application version 1.1.0 contains invalid YAML or JSON. YAML exception: Invalid Yaml: unacceptable character '' (0x0) special characters are not allowed in "", position 0, JSON exception: Invalid JSON: Unexpected character () at position 0.. Update the configuration file.
*INFO Environment update is starting.
SOLUTION
This is because MACOS includes some extra hidden folders which you need to exclude from your ZIP file. To do this, run this command in terminal on your zip:
$ zip -d nameofyourzipfile.zip __MACOSX/\*
Now re-upload, and you should get a success message:
INFO Environment update completed successfully.
INFO New application version was deployed to running EC2 instances.
Hope this solved your issue!
The reason for this problem in the Elastic Beanstalk system was in fact in the zip that is created in the Mac osx platform.
if you upload the new version with eb deploy command and not by zipping the application, then the problem doesn't appear!
Hope this helps someone, as it has been troubling me for so long!!
When you zip folders on MACOSX, it will add its own hidden files in there alongside yours.
If you want to make a zip without those invisible Mac resource files such as “_MACOSX” or “._Filename” and .ds store files, use the “-X” option in the zip command
$ zip -r -X archive_name.zip folder_to_compress
If this is a pre-existing zip file, you can use the command others here have mentioned
$ zip -d nameofyourzipfile.zip __MACOSX/\*
Work around on Mac
Since it opens up the zip file and when you compress it, Elastic Beanstalk gives the error mentioned above. If you run command in previous comments to remove MACOSX related stuff, it still gave me an error about one of the files not found.
Workaround is that before doing the download, rename the zip file to some other extension and change to zip once its on the Mac.
When you upload this file to Elastic Beanstalk, it will work fine.

Zend Framework 2 Getting Started on WAMP server

I have been trying to follow this tutorial: Tutorial
I can't get past page 2. When I try to run the command:
php composer.phar create-project --repository-url="http://packages.zendframework.com" C:\wamp\www\zendTutorial
I get these messages:
[RuntimeException]...[Composer\Downloader\TransportException]<br>
The "http://packages.zendframework.com/packages.json" file could not be downloaded: failed to open stream: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
I enabled ssl_module in the Apache modules and php_openssl in PHP extensions and a runtime error window popped up which I didn't read because I thought I would restart the server and everything would be okay.
Then I found out I had to create a private/public key pair so I followed this tutorial: tutorial
But I realized I skipped the step where I have to download WSAS (the 3rd application to download just to get this pig to oink) to export my pk from the keystore and I decided to put on the brakes and ask "really?" Is there a shortcut I can take to bypass all this crap so I can start with the tutorial? I've been at this for the past 3 hours and I am so fed up - it's demoralizing.
Note Another way to install the ZendSkeletonApplication is to use github. Go to https://github.com/zendframework/ZendSkeletonApplication ...
Try it this way. Get git and clone the repository from
https://github.com/zendframework/ZendSkeletonApplication.git
To do this, change in console (cmd.exe) to your workspace and type
git clone https://github.com/zendframework/ZendSkeletonApplication.git
It should create a subfolder ZendSkeletonApplication with the skeleton application inside.
Later when you have your skeleton application project you can run composer as described in the tutorial to get the dependencies.

Resources