Reporting on Octopus Deployment steps - octopus-deploy

Is it possible to report on / query the data that is displayed here (red arrows in screen shot below) for individual octopus deployment steps? I have looked at the database schema and their RESTful API but don't see anything. I am trying to generate a report that aggregates time spent for each process across deployments.

The information presented here is calculated from the task log. You can access the task log via the API at /api/{spaceId}/tasks/{taskId}/raw
For example:
| == Success: Step 1: Run a Script ==
01:04:18 Verbose | Run a Script completed
|
| == Success: Worker ==
01:04:12 Verbose | Octopus Server version: 2022.3.425
01:04:12 Verbose | Environment Information:
-- snip ---
01:04:18 Verbose | Successfully finished Run a Script on a Worker
|
From the Task Log view:
There is some examples of interacting with the API for tasks in the OctopusDeploy-Api repo, such as this one to get task details.

Related

Bitrise Google Play Deploy start failing, which used to work fine

The logs around the error is this below. It used to work but after a few days ago, this start failing. I didn't not change deploy flow.
The only change is that we started to pay. Before that we used it as a trial member.
Though I don't think that is the cause...
Does anyone know how to get over this error?
Using app from: /Users/vagrant/deploy/app-production-[REDACTED]-bitrise-signed.apk
Configuration read successfully
Authenticating
Authenticated client created
Create new edit
editID: xxxxxxx
Edit insert created
Upload apks or app bundles
Uploading /Users/vagrant/deploy/app-production-[REDACTED]-bitrise-signed.apk 1/1
Uploaded apk version: 36
Done uploading of 1 apps
New version codes to upload: 36
Applications uploaded
Update track
Release version codes are: [36]
alpha track will be updated.
updated track: alpha
Track updated
Committing edit
Failed to commit edit, error: googleapi: Error 403: You cannot rollout this [REDACTED] because it does not allow any existing users to upgrade to the newly added APKs., forbidden
| |
+---+---------------------------------------------------------------+----------+
| x | google-play-deploy#3.6 (exit code: 1) | 19.44 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-google-play-deploy/issues |
| Source: https://github.com/bitrise-io/steps-google-play-deploy |
+---+---------------------------------------------------------------+----------+

Storing Artifacts From a Failed Build

I am running some screen diffing tests in one of my Cloud Build steps. The tests produce png files that I would like to view after the build, but it appears to upload artifacts on successful builds.
If my test fail, the process exits with a non-zero code, which results in this error:
ERROR: build step 0 "gcr.io/k8s-skaffold/skaffold" failed: step exited with non-zero status: 1
Which further results in another error
ERROR: (gcloud.builds.submit) build a22d1ab5-c996-49fe-a782-a74481ad5c2a completed with status "FAILURE"
And no artifacts get uploaded.
I added || true after my tests, so it exits successfully, and the artifacts get uploaded.
I want to:
A) Confirm that this behavior is expected
B) Know if there is a way to upload artifacts even if a step fails
Edit:
Here is my cloudbuild.yaml
options:
machineType: 'N1_HIGHCPU_32'
timeout: 3000s
steps:
- name: 'gcr.io/k8s-skaffold/skaffold'
env:
- 'CLOUD_BUILD=1'
entrypoint: bash
args:
- -x # print commands as they are being executed
- -c # run the following command...
- build/test/smoke/smoke-test.sh
artifacts:
objects:
location: 'gs://cloudbuild-artifacts/$BUILD_ID'
paths: [
'/workspace/build/test/cypress/screenshots/*.png'
]
Google Cloud Build doesn't allow us to upload artifacts (or run some steps ) if a build step fails. This is the expected behavior.
There is an already feature request created in Public Issue Tracker to allow us to run some steps even though the build has finished or failed. Please feel free to star it to get all the related updates on this issue.
A workaround per now is as you mentioned using || true after the tests or use || exit 0 as mentioned in this Github issue.

Deploying on Netlify throws an error with my GraphQL/Gatsby/Contentful query, demands needless query parameter

At first I was getting this error on my local build server, but I managed to fix it there... the query is still the same, but gatsby isn't throwing any errors with the query. But every time I try to deploy on Netlify it fails with the following message:
toFormat seems to be empty, we need a fileExtension to set it.
1 | fragment GatsbyContentfulFluid_tracedSVG on ContentfulFluid {
> 2 | tracedSVG
| ^
3 | aspectRatio
4 | src
5 | srcSet
6 | sizes
7 | }
failed during stage 'building site': Build script returned non-zero exit code: 1
8 |
9 | query optbuildreposrccomponentsshopProductsJs2136335468 {
10 | products: allContentfulProduct {
11 | edges {
12 | node {
Shutting down logging, 22 messages pending
File path: /opt/build/repo/src/components/shop/Products.js
Plugin: none
This is the same error I was getting locally and I have no idea why it is occurring. There should be no reason that toFormat is a required parameter. This is using the standard gatsby-source-contentful plugin API request which has always served the image without issue in the past. If I change the request to 'fixed' instead of 'fluid' the problem goes away, but I need fluid images for this part of the site.
I emailed the Netlify staff a few days ago, but am yet to receive a reply. Any help would be greatly appreciated.
For Those who are facing the same issue I came up with a simple solution.
Remove from all your file places that you used this extension _tracedSVG.
eg.
GatsbyContentfulFixed_tracedSVG
to
GatsbyContentfulFixed
Stop your gatsby server and use the follow command:
gatsby clean && gatsby develop
Commit and push your changes (in case you are using Github)
On Netlify find the option: Clear cache and deploy site
It should fix your Deployment on Netlify as well errors on your console :)
Two suggestions:
Local: Double check your content for any image references that do not append a suffix of .png or .jpg
Netlify: Clear cache and deploy site

Octopus Deploy : "Skipping this step as no matching targets were found"

We have several projects in Octopus Deploy Cloud and we have never had issues deploying to the existing targes.
As of today, all deployment steps get skipped with this message in the logs:
Skipping this step as no matching targets were found
This has affected all projects, all channels and all environments (we have five different environments in five different AWS accounts).
== Skipped: Step 1: Create or Update IIS Website == 10:40:29
Verbose | Searched for targets: 10:40:29 Verbose | *
specifically matching these ids: Machines-534 and Machines-535
| * that are enabled
| * with no id exclusions
| * with no environment exclusions
| * has a role that overlaps: APII
| * with no tenant exclusions
| * has a health status of: Healthy or HasWarnings 10:40:29 Info | Skipping this step as no
matching targets were found
The above is part of the raw log.
All deployment targets in the given environment and channel are Healthy (green). Any idea what can be the cause of this?
You have encountered this bug. This issue can be resolved by upgrading to 2019.10.12 or later.

Sonarqube : The 'report' parameter is missing

I am using MSBuild. I have Java 8 installed.
I am running the following commands:
SonarQube.Scanner.MSBuild.exe begin /k:"ABC" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="8b839xxxxxxxxxxxxxxxxxxxxxxx6b00125bf92" /d:sonar.verbose=true
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" /t:rebuild
SonarQube.Scanner.MSBuild.exe end /d:sonar.login="8b839xxxxxxxxxxxxxxxxxxxxxxx6b00125bf92"
The last step fails:
ERROR: Error during SonarQube Scanner execution
ERROR: The 'report' parameter is missing
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
12:53:21.909 Creating a summary markdown file...
12:53:21.918 Post-processing failed. Exit code: 1
The MSBuild version is greater than 14.
Java 8 is properly installed. Documentation indicates that Java 8 is adequate.
Any idea on what could be wrong?
Where do I add the -X switch? I tried on all 3 statements
Update :I installed Java SDK 9. Still same issue.
Update :With verbose logging and using /n naming parameter:
INFO: Analysis report generated in 992ms, dir size=4 MB
INFO: Analysis reports compressed in 549ms, zip size=1 MB
INFO: Analysis report generated in C:\ABC\.sonarqube\out\.sonar\scanner-report
DEBUG: Upload report
DEBUG: POST 400 http://localhost:9000/api/ce/submit?projectKey=ABC | time=1023ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 54.833s
INFO: Final Memory: 51M/170M
INFO: ------------------------------------------------------------------------
DEBUG: Execution getVersion
DEBUG: Execution stop
ERROR: Error during SonarQube Scanner execution
ERROR: The 'report' parameter is missing
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Process returned exit code 1
The SonarQube Scanner did not complete successfully
Creating a summary markdown file...
Post-processing failed. Exit code: 1
I've struggled the same problem with SonarQube and I've finally found a solution:
You need to restart sonar service after using evaluation token.
Please note this isn't the answer, however I feel this feedback is valuable to getting this question answered.
I can reproduce this issue in POSTMan with a POST request to:
http://localhost:9000/api/ce/submit?projectKey=myProjectKey
This returns
{
"errors": [
{
"msg": "The 'report' parameter is missing"
}
]
}
You can get a similar error by removing the projectKey query parameter. I tried adding a report query parameter and received the same error:
http://localhost:9000/api/ce/submit?projectKey=brian3016&report=report
Given this, I feel there is a problem with their code. It should have included a report parameter when creating the POST request, but it failed to do so.
Verbose output seems to have changed from using the -X switch to /d:sonar.verbose=true. E.G.
SonarScanner.MSBuild.exe begin /k:"myProjectKey" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="myLogin" /d:sonar.verbose=true
Note the verbose logging didn't give me any valuable insight.
(Also note that the documentation currently says to use SonarQube.Scanner.MSBuild.exe, but the verbose logger told me to switch to SonarScanner.MSBuild.exe)
SO...how we we report this issue to someone that can fix it? Their documentation says to go to Stackoverflow. So here we are.
I thought it may have been an issue with a project. So I created a new project with nothing other than the startup template Console Application. Same error.
In my case SonarQube 7.9.1 (deployed with Helm to Kubernetes cluster) was missing temp directory /opt/sonarqube/temp/tc/work/Tomcat/localhost/ROOT after Helm rollback. No idea what happened to it.
Logfile /opt/sonarqube/logs/web.log inside SonarQube pod had this error:
2021.02.02 06:57:03 WARN web[AXdZ6l6MParQCncJACv3][o.s.s.w.ServletRequest] Can't read file part for parameter report
java.io.IOException: The temporary upload location [/opt/sonarqube/temp/tc/work/Tomcat/localhost/ROOT] is not valid
The fix was to exec into pod and create the missing directory. Would like to know the reason though...
The issue is with the sonar service starting up.
First try to stop the SonarStart.bat by using Ctrl+c, and then try to open localhost:9000 ( or whichever port you configured sonar server).
If it is still opening then go to task manager and search for wrapper.exe service and stop the service. If no service is found then go to:
Task manager>Details> and stop all java.exe process.
Note: If you running many Java applications, right-click the java.exe and choose goto service, and stop only those java.exe that belongs to AppX deployment.services
Now start sonarstart.bat as administrator..
today i face the same error when using jenkins to scanner the code.
get the error when POST /api/ce/submit and get 400 code by add the sonar.verbose=true
i use the below step to check reason
first to restart the sonarqube => failed
check the report file size by using "du -sh" get 108m and DB server support 1G => failed
login the sonar-qube server and check the access.log, web.log and another log, finally find the error reason " Processing of multipart/form-data request failed. No space left on device", so i check the server by command "df -h", some devices are used 100% => so i remove some no-using file and fix it!!!
check if you have enough memory
ex: free -m
In my case I had to upgrade memory.

Resources