Google cloud - Stackdriver debug reports "File was not found in the executable" for GCE Jetty war - google-compute-engine

I've been trying to follow the
Setting Up Stackdriver Debugger for Java applications on Google Compute Engine, but am running into issues with Stackdriver Debug.
I'm building my .war file from a separate build server, then deploying it to my GCE server. I added the agent to the start command via /etc/defaults, and my app appears in the https://console.cloud.google.com/debug control panel. The version I set in the run command matches the revision that shows up in the source-context(s).json files.
However when I click open the app, I see the message that
No source version information was provided by the deployed application
I connected the app's git repo as a mirrored cloud repository, and can browse the source files in the sidebar of the Stackdriver Debug page. But, If I browse to a file and add a breakpoint I get an error that the error "File was not found in the executable."
I have ran the gcloud preview app gen-repo-info-file command, which created two basic json files storing my git repo and revision. Is it supposed to do anything else?
I have tried running jetty using both normal and extracted modes. If I have jetty first extract the war file, I can see the source-context.json filesin the WEB-INF/classes directory.
What am I missing?

https://github.com/GoogleCloudPlatform/cloud-debug-java#extra-classpath mentions
you can update the agentPath showing your WEB-INF/class directory.
-agentpath:/opt/cdbg/cdbg_java_agent.so=--cdbg_extra_class_path=/opt/tomcat/webapps/myapp/WEB-INF/classes
For multiple class paths:
-agentpath:/opt/cdbg/cdbg_java_agent.so=--cdbg_extra_class_path=/opt/tomcat/webapps/myapp/WEB-INF/classes:/another/path/with/classes

There are a couple of things going on here.
First, it sounds like you are doing the correct thing with gen-repo-info-file. The debugger agent should pick up the json files from the WEB-INF/classes directory.
The debugger uses fuzzy matching to find source files, so as long as the name of the .java file matches a file in your executable, you should not get that error.
The most likely scenario given the information in your question is that you are attaching the debugger to a launcher process, rather than your actual application. Without further details, I can't absolutely confirm that, though.
If you send us more details at cdbg-feedback#google.com, we can look more closely at your case to see if we can understand exactly what's happening, and potentially improve our documentation, since it sounds like you followed the docs pretty closely.

Related

Where does the downloaded file go when execute robot framework using Jenkins

I need one help,
I am Executing a script of robot framework using Jenkins, as per the flow the script should download one XLS and validate the data using Pandas.
When I am executing the script using Jenkins and searching the downloaded file in a hardcoded path i.e. "C:\Users\Administrator\Downloads" the file is not found.
but when executing it manually the file downloaded on the same path
Can anyone please help me by telling me where do Jenkins stores all the downloaded files?
PS : I am using Google Chrome as web browser
For each job Jenkins runs, it creates a workspace directory, usually at:
$JENKINS_HOME/workspace/(Name of the Job)
The scripts (and robotframework's in this case) are run there, as the root directory. Most probably the downloaded file will be in a path from there (or an error should have occurred because the Jenkins user does not have access to the C:\Users... path).
There is a step in the Jenkins job, which is to archive (download) files from workspace, to Jenkins database, to be shown as "artifacts". Even the screenshots images or videos recording, must be registered in that step, so they can be viewed on the Report and Log in Jenkins (Robot Framework Plugin).

chrome : unable to read local files by using `-allow-file-access-from-files `

Introduction
Honestry,I'm not native English user,so my English is not better.
If you have any question, ask me by comment.
what I wanna do
As a premise,when you try to access local files by web site link,IE or FireFox can access( by simple setting) ,but Chrome can't access for their security poricy.
I found the ways to do this, like below:
add --allow-file-access-from-files option when you execute chrome.exe
build a local server like nginx or Apache HTTP Server,which meditate to access local data
Use chrome extentionEnable local file links
Due to business restrictions,I should resolve this problem by method 1. but I can't enable loacl data link though I set option correctly.
I googled why I can't,but I couldn't find why it won't work.
(In the first place,I can't even find Google official description of --allow-file-access-from-files.How predecessors find that method ... )
While searching、I found person who have the same question、Google Forum.
I'm convinced that this is not my simple miss,but more deep problem,so I decided to make this question.
what I tried
I rebooted computer,killed all process related to chrome,then change directory where contains chrome executable file,and execute chrome.exe --allow-file-access-from-files
I rebooted computer,killed all process related to chrome 、create shortcut on my Desktop ,which destination is "/path/to/chrome/chrome.exe"--allow-file-access-from-files
After execute chrome,I checked chrome boot option to accesschrome://version/.Both method, I could boot chrome by add --allow-file-access-from-files option,but can't achieve first purpose to access local file access.
what I wanna know
lacking or similar to --allow-file-access-from-filesoption、
(solution similar to method 2 or method 3,like "Give up option solution,and use nginx as local server" is unnecessary)
or other solution
Additionary,if you know below info,please teach me.
- Google official documentation which descriptionsallow-file-access-from-files
( Indended to Oracle official Javadoc of Java.)
Using Tool
Chrome Version : 78.0.3904.87
OS : WIndows 7 SP1

Can't execute setup.py (Error 5 - Access Denied)

I ran into a problem creating a new project in Cocos2d-x 3.1.1 (or 3.0 - it happens at both versions).
When I'm running the build script in console (Windows 8 - console with admin privileges) an WindowsError pops up (check the image below).
http://i.imgur.com/Ixg4jEE.png
I can set up the COCOS_CONSOLE_ROOT manually, but it does not help with the Error 5.
I tried setting the 777 priviligies an all cocos2d-x folder and subfolders, but it does not help.
Anybody had the same problem? Any solutions out there?
On Windows you should not put manually installed programs and tools under C:\Program... (english: C:\Program Files) because that's a folder where only apps with a proper installer should go. Otherwise you will keep having permission issues. Apps are not allowed to write to that folder or any of its subfolders.
Since cocos2d-x isn't an app, it can't redirect its output to the proper AppplicationData folder as is mandated by the operating system. Not being able to write or modify the program folder's contents (except during installation) is a security feature in Windows that you can't (or shouldn't) bypass.
To fix this simply extract cocos2d-x in a folder that both you and apps have full read/write permission. Normally this would be in your Documents folder, but Desktop would also work and probably just any folder on a drive that you created, for instance C:\cocos2d-x.
Due to this line:
_winreg.SetValueEx() ...
the actual problem looks like to be with registry access, rather than with file permissions.
Make sure you actually running console as an admin, by:
searching cmd in Windows search, or just creating a shortcut to it to desktop
right clicking to cmd.exe and choosing "Run as administrator"
Make sure you don't have registry access block in any way: like blocking in group policies, some "security optimization" software and viruses and antiviruses.
Make sure your python version is 2.x. Python 3.x is not supported.
Anyway, this 'setup.py' step is optional for using cocos2d-x and you can live without running it at all.

How to monitor specific folder and save content of each log file in that folder to mysql database

We are developing a service for our QA staff.
The main goal is that a tester from our web interface be able to select from a github branch a dump for this particular machine and click "Deploy" button, then the rails app for testing will be deployed to Digital Ocean.
The feature I am now working on, is collecting deployment logs and displaying them through our web interface.
On DO droplet there is a "logs" folder which contains different log files which are populated during deployment:
migrations_result_#{machine_id}.log, bundle_result_#{machine_id}.log, etc.
Where #{machine_id} is the id of deployed machine on our service(it is not droplet id).
With the help of remote_syslog gem we are monitoring "logs" folders on each droplet and send them through udp to our main service server, and with the help of rsyslog we store them in a particular folder, let's say /var/log/deplogs/
So in /var/log/deplogs/ we have:
migrations_result_1.log, bundle_result_1.log,
migrations_result_2.log, bundle_result_2.log,
...
migrations_result_n.log, bundle_result_n.log
How do I need to monitor this folder and save contents of each log file to mysql database?
I need to achieve something like the following (Ruby code):
Machine.find(#{machine_id}).logs.create!(text: "migrations_result_#{machine_id}.log contents")
Rsyslog does not seems to be able to achieve this. Or am I missing something?
Any advices?
Thanks in advance, and sorry for my English, I hope you can get the idea.
First of all, congratulations! You are in front of a beautiful problem. My suggestion is to use divide and conquer.
Here are my considerations:
Put the relevant folder(s) under version control (for example, GIT)
Check via GIT commands the files that changed every X amount of time.
Also obtain the differences between the prior version of each file, and the new ones, so you can update your database parsing the new info.
Just in case, here are ways to call system commands from ruby.
Hope that helps,

Jenkins/Hudson Upload to Testflight

I have a jenkins job using xcode to build my ipa file. That is all working great. Right now I just have the Marketing version set to ${BUILD_ID} and the technical version set to ${BUILD_NUMBER}. I also have Release configuration specified and my job is set to archive the ipa files as a post build action. I believe those combination of settings causes my resulting IPA file to be the following:
Target-Configuration-BUILD_NUMBER.ipa
So if my target was named BillyBob and this was the 23rd successful build, my resulting .ipa file is:BillyBob-Release-23.ipa
I want to setup a job or post-build action to upload my file to testflight on a successful build.
I can not figure out what to set the file parameter of the testflight API to so that it will always find the latest build file, I don't think there is a wildcard available or if there is I don't know how to set it.
Originally, when I wasn't setting the technical version as part of the build I had it just pointed to the -1.0.ipa version of the file it was creating and that would get uploaded fine.
I've tried using both the testflight plugin for jenkins and just a curl shell script command.
I will also point out that I'm not an iOS developer, I've just been trying to help the project by setting up the automated build, so my guess as to how that file is getting generated could be way off.
***UPDATE
So it looks like this current open issue is kind of what I am looking for
jenkins issue section
For now, I just had my job specify an output path that is the workspace of my upload to testflight job.
It looks like in the Testflight app, if you don't specify anything for the IPA file, it looks for one in the workspace directory of that job. So I could probably also put in a request to the testflight plugin to allow you to specify a path in the IPA setting and have it find the .ipa file in that path, that currently does not work.
If I was better at scripting I could probably also handle it in a shell command using the curl command to upload to testflight.
Leaving those fields empty in Jenkins fixed it for me.
If you do not specify the ipa/dsym file(s) they are searched for
automatically in the workspace.
As you can see from:
https://wiki.jenkins-ci.org/display/JENKINS/Testflight+Plugin
Version 1.3.1 (Jan 12 2012)
* Default IPA upload