TeamCity REST API build getStartDateTime() returns NULL for a running build - teamcity

I'm using
org.jetbrains.teamcity:teamcity-rest-client:1.14.0
after TeamCity server update from 2022.04.3 to 2022.04.4
TeamCityInstanceFactory.guestAuth("my_teamcity_server_url")
.build(new BuildId("id_of_started_but_not_finished_yet_build"))
.getStartDateTime()
returns null if the build is running.
It returns correct ZonedDateTime once the build has finished

If I run a REST call via browser with guest authentication:
GET /app/rest/builds/id:[id_of_started_but_not_finished_yet_build]
TeamCity returns incomplete XML response like first 1063 characters
and HTTP response code is 403
It works fine if I authenticate as a non guest user
so the workaround is to use httpAuth() instead of guestAuth()
TeamCityInstanceFactory.httpAuth("my_teamcity_server_url", "user", "password")
.build(new BuildId("id_of_started_but_not_finished_yet_build"))
.getStartDateTime()

Related

What is the request that whatsapp cloud api does to verify a webhook?

I'm able to verify the webhook using glitch from the getting started:
https://glitch.com/edit/?fbclid=IwAR2YTjZuGGM9Hi6T_v1eZh_nV6_HY3RYn_8lll4gY1REa_bJy6ZAuq6tkKQ#!/whatsapp-cloud-api-echo-bot
my local server (in a subdomain with https enabled) has the same behavior as glitch and show "WEBHOOK_VERIFIED" on the log for the request:
/webhook?hub.mode=subscribe&hub.verify_token=xpto123&hub.challenge=123
but when try to verify my local server the request from meta does not reach the server.
chrome showing that the connection to the server is secured
After more tests I found that my local server was been blocked by the ISP, understood it after test with another connection.
I made my own server and had tried ngrok and other programs to run it from local host with https redirect but whatsapp doesn't allow the use of those programs.
In the end, my error was that the URL HAS to end in /webhook or else, it won't even send the request. Then it'll send a GET request and you have to return the hub.challenge query param after making sure that the provided token from them is the one you set up. This is my code using NodeJS
if(req.query['hub.verify_token'] === process.env.VERIFY_TOKEN) return res.status(200).send(req.query['hub.challenge'])

Getting Null Pointer Exception when trying to run the login script in Jmeter

I have recorded the login page script in blazemeter and trying to run it in JMeter but it's throwing Null Pointer exception error. Also for another script I am getting 401 unauthorized error code even if I have added the username, password, base URL in authorization manager.
For the first error, JMeter is saying that it is a Null pointer exception, without seeing your JMeter logs it is very difficult to predict what causing the issue.
The second error, since it is KERBIOS authentication, you need to make some changes in krb5.conf file and JMeter system properties file as well.
I would suggest you to checkout this well written article about windows authentication in JMETER: Windows Authentication with JMETER

Apache Jmeter is not giving any error even we gave wrong credentials

I am new to JMeter. I am using it for load testing for Microstrategy web dossiers. I am loading the users from CSV Config file. I have generated steps using Badboy software and exported as Jmeter file. I have added variables for userID and password. I have enabled "Retrieve all Embedded Resources". When I ran the testing. I observed that its giving same response even if password is wrong. taskProcs are giving connection closed error. I have searched with dossier ID in both the cases , I am able to see the request and response same even if password is wrong. Can you help me how to identify whether the credentials matched or not ? I would like to throw error when password didn't match ? I thought of adding Response Assertions but responses are same.
JMeter automatically treats HTTP Response Status codes below 400 as successful. So if HTTP Request sampler returns status 200 (or any other between 100 and 399) it's treated as success.
JMeter doesn't perform any checks for content, if you need to add explicit pass/fail criteria basing on the response body, presence or absence of certain text, sampler execution time, etc. you need to add a relevant Assertion and put the anticipated success criteria into the assertion.
First JMeter doesn't generate any error codes or error messages itself, what it actually do is working as client and giving back what application sends to JMeter.
I think first you have to make sure application works correctly, then check whether Jmeter scripts work correctly. For that add debug sampler before the API request and check whether variables username, password has evaluated correctly from the csv.

Google APIs OAuth refresh token url return 401 on http redirect uri?

I had implemented the code to received authorization code as described in this step:
https://developers.google.com/android-publisher/authorization#generating_a_refresh_token
We deployed this code to one server that has "https://..." domain and this works well. We can get the access_token, refresh_token...
But now we need to deploy the same code to a dev server that has no "https".
I created a new OAuth client id with redirect uri using the dev server (no https, the rest /api/v1/... is the same as the previous working server)
Now anytime I tried to go to this url and Allow access
https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher&response_type=code&access_type=offline&redirect_uri=http://dev_server/api/v1/...&client_id=dev_server_client_id
I got 401 Unauthorized.
I'm not sure why, but the only difference I can see is "https" vs "http".
Any idea why?
Thank you very much.
Actually I forgot to update the corresponding values in my code
const oauth2Client = new OAuth2(
config.googleApi.clientId,
config.googleApi.clientSecret,
config.googleApi.redirectUri // <= Especially this value
);
These values need to be updated to (beside values on google console).

Getting Error 401--Unauthorized in Postman when using post method to make a to call external API

I am trying to get the response back from API using Postman native app in windows 10.
I am in my company system which uses proxy, so i need to pass proxy credentials for every request which i send from my system.
As per postman documentation, i set proxy settings but still getting 401: Unauthorized error.
Postman Proxy Settings
Other suggestion was to use Basic Authentication while sending a request. It doesn't help either:
Baisc Auth settings for Proxy in postman
I tried all the things in native app but it's not working.
The workaround is to use Chrome extension for Postman.
Please refer the steps below:
1.> Search for Postman Interceptor chrome extension
2.> Install the extension
3.> Launch postman extension
4.> Login using your google account Or register an account in postman.
5.> When you try to login, pop appear in which proxy userid and password needs to be entered.
6.> Once proxy settings has been updated, send the request. You should receive expected response back.
Happy coding :)

Resources