API Request works perfectly on Postman but returns empty body in response from Mulesoft API - request

I'm doing the same request on Postman and on a Mule Flow.
If I use a simple request body (a JSON with 60 lines for example), it works fine on both.
But then, when I use a big request (it has 5545 lines), this problem occurs.
EDIT:
ok, just to make it clear since its all basicly dummy data and I need help. IF the request body has only this 5 items on the order array (the request is too long for this post, so i'm making it smaller for example purporses) it works fine:
{
"orders": [
{
"increment_id": "000001501",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001502",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001503",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001504",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001505",
"old_order_id": "",
"total_qty_ordered": 1,
},
]
}
BUT, if this same request contains like 8 or more items in the "orders" array, the respose body returns empty:
{
"orders": [
{
"increment_id": "000001501",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001502",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001503",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001504",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001505",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001506",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001507",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001508",
"old_order_id": "",
"total_qty_ordered": 1,
},
{
"increment_id": "000001509",
"old_order_id": "",
"total_qty_ordered": 1,
}
]
}
The request headers differs as it follows:
Mulesoft request header:
POST /api/v1/SALES_ORDER HTTP/1.1
x-correlation-id: 1a0d03f0-626d-11eb-9b2e-b663a1179158
Host: HOST:PORT
User-Agent: AHC/1.0
Connection: keep-alive
Accept: */*
Content-Type: application/json; charset=UTF-8
Content-Length: 165216
Postman request header:
POST /api/v1/SALES_ORDER HTTP/1.1
Host: HOST:PORT
User-Agent: PostmanRuntime/7.26.10
Connection: keep-alive
Accept: */*
Content-Type: application/json; charset=UTF-8
Content-Length: 165216
Again, I'm sending the SAME BODY request, but even tough the response is a 200 status code, the body on Mulesoft is returned empty (even the "Content-length" header is 0 only on Mulesoft)
Mulesoft response header:
HTTP/1.1 200 OK
Date: Fri, 29 Jan 2021 17:51:06 GMT
Server: Apache
Upgrade: h2
Connection: Upgrade, Keep-Alive
X-Powered-By: Undertow/1
Set-Cookie: JSESSIONID=5rNuv5ZX5ohn96xcd9YKahXSw414wxzZ7Y3PIRqw.loyaltyqaukpt; path=/b2becon
Set-Cookie: com.anm.octashop.country=IN; path=/
Set-Cookie: com.anm.octashop.lang=pt; path=/
country: IN
Content-Length: 0
Content-Language: pt-
Keep-Alive: timeout=5, max=100
Content-Type: text/html;charset=UTF-8
Postman responde header:
HTTP/1.1 200 OK
Date: Fri, 29 Jan 2021 17:51:06 GMT
Server: Apache
Upgrade: h2
Connection: Upgrade, Keep-Alive
X-Powered-By: Undertow/1
Set-Cookie: JSESSIONID=xeqWEjuRcZ319zd8ZXtOnF0xN_-NEi-xygwGk05p.loyaltyqaukpt; path=/b2becon
Set-Cookie: com.anm.octashop.country=IN; path=/
Set-Cookie: com.anm.octashop.lang=pt; path=/
country: IN
Content-Length: 4372
Content-Language: pt-
Keep-Alive: timeout=5, max=100
Content-Type: text/html;charset=UTF-8
EDIT (Versions):
Mule Server Runtime: 4.3.0
API Kit Module: 1.4
Anypoint MQ Connector - Mule 4: 3.1.2
HTTP Connector - Mule 4: 1.5.23
MUnit: 2.3.1
MUnit Tools: 2.3.1
Secure Configuration Property Extension - Mule 4: 1.2.3
Sockets Connector: 1.2.1

As I understood your issue, the request through postman is working fine but in mules flow it is creating an issue than the issue is in our mule flow
try to debug your code and put debug points
at HTTP requestor of external API that you are hitting in mule flow
after HTTP requestor
check in the debugger that what the response is coming just after the HTTP requestor is empty or not.
Thanks

Related

Java web service/AngularJS - sometimes API's body received partially with gibberish

I'm trying to understand why sometimes (only sometimes and not all the time) the same API call body arrives to the server in corrupted format (partially with gibberish) in spite of the fact that from the browser (Chrome, Firefox, Edge) it is sent properly.
I Will be glad to hear any ideas!
API call example (same as sent from browser):
Request URL: https://localhost/api/web/getMainData
Request Method: POST
Remote Address: 123.45.67.89:443
Referrer Policy:strict-origin-when-cross-origin
Response Headers:
cache-control: no-cache, no-store, max-age=0, must-revalidate
content-type: application/json;charset=UTF-8
date: Wed, 16 Mar 2022 11:16:43 GMT
expires: 0
pragma: no-cache
server: nginx/1.10.3 (Ubuntu) ---> used proxy server
Request headers:
:authority: quilliup-trn.advantagegroup.com
:method: POST
:path: /api/web/getMainData
:scheme: https
accept: application/json, text/plain, /
accept-encoding: gzip, deflate, br
accept-language: en,en-US;q=0.9
content-length: 10157
content-type: application/json;charset=UTF-8
cookie: JSESSIONID=3C1DB6D3A840B2703F27431966F92B5E
guid: 5c24e7ab-75b6-4339-af02-51e310b21727
origin: https://localhost
referer: https://localhost/
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Payload/Body:
{
"id": "abc44b66-847d-4805-ae7d-f0285cf3d123",
"filterOptions": {
"advancedTxt": "",
"operand": "or",
"advanced": {}
},
"filterDDOptions": {
"advanced": {}
},
"pageSize": 100,
"pageNumber": 1,
"responseStructure": [...],
"sortinfo": {
"fields": [
"Company Code"
],
"directions": [
"asc"
]
}
}
Error from log file:
"... received json body is:
� 5ۂ� �`u��N; $RXz��*C ��F �|�� ѕf��Vy׀���/6��p$� 2N]� �l�.4�B&#�=�]��R'$��H(�mgٔ�4�2,�%�i �i� � �׾����������tions":{"advanced":{}},"pageSize":100,"pageNumber":1,"responseStructure":[{"displayName":"Company Code" ..."
Additional details:
Java 1.8.0_302
AngularJS
nginx/1.10.3 (Ubuntu) - used proxy server

Certbot: "Some challenges failed" when trying to create certificate for wildcard for app on Google Cloud Platform's App Engine

example.com is just as an example. I do own the domain I am trying to work with.
What am I trying to do?
I want to generate an SSL wildcard certificate using certbot to use on Google Cloud Platform, so that urls like https://this.example.com work.
What have I done?
I have an app engine instance running that uses a custom domain name (example.com).
I have a DNS zone in Cloud DNS with example.com as DNS name. A/AAAA records pointing to the same IPv4 & IPv6 addresses as are specified in the custom domain tab of App Engine.
What works?
Navigating to https://example.com or https://www.example.com works. Navigating to http://example.com or http://www.example.com redirects to https.
What doesn't work?
This is the command I ran:
sudo certbot certonly --dns-google --dns-google-credentials *CREDENTIALS* -d *.example.com
With CREDENTIALS being the location of my service account key file.
After a few minutes, I get an error:
Domain: example.com
Type: unauthorized
Detail: No TXT record found at _acme-challenge.example.com
To fix these errors, please make sure that your domain name was entered correctly and the DNS A/AAAA record(s) for that domain contain(s) the right IP address.
What do I think it could be?
I am hoping it just takes a while to update, but I am not sure.
**EDIT:
The logs. It went through an automatic secret remover tool before I shared it here. Let me know if it removed something that you need to see!
**EDIT2: Added new logs & IAM role(s) for SA
The Service Account I am using has DNS Administrator as role.
FILE_LOCATION = Location of credentials file
***** = Hidden
2021-11-25 21:18:03,991:DEBUG:certbot.main:certbot version: 0.40.0
2021-11-25 21:18:03,992:DEBUG:certbot.main:Arguments: ['--dns-google', '--dns-google-credentials', 'FILE_LOCATION', '-d', '*.example.com', '--dns-google-propagation-seconds', '120']
2021-11-25 21:18:03,992:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#dns-google,PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2021-11-25 21:18:04,003:DEBUG:certbot.log:Root logging level set at 20
2021-11-25 21:18:04,003:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2021-11-25 21:18:04,004:DEBUG:certbot.plugins.selection:Requested authenticator dns-google and installer None
2021-11-25 21:18:04,004:DEBUG:certbot.plugins.selection:Single candidate plugin: * dns-google
Description: Obtain certificates using a DNS TXT record (if you are using Google Cloud DNS for DNS).
Interfaces: IAuthenticator, IPlugin
Entry point: dns-google = certbot_dns_google.dns_google:Authenticator
Initialized: <certbot_dns_google.dns_google.Authenticator object at 0x7ff1c3afc7c0>
Prep: True
2021-11-25 21:18:04,004:DEBUG:certbot.plugins.selection:Selected authenticator <certbot_dns_google.dns_google.Authenticator object at 0x7ff1c3afc7c0> and installer None
2021-11-25 21:18:04,004:INFO:certbot.plugins.selection:Plugins selected: Authenticator dns-google, Installer None
2021-11-25 21:18:04,008:DEBUG:certbot.main:Picked account: <Account(RegistrationResource(body=Registration(key=None, contact=(), agreement=None, status=None, terms_of_service_agreed=None, only_return_existing=None, external_account_binding=None), uri='https://acme-v02.api.letsencrypt.org/acme/acct/*****', new_authzr_uri=None, terms_of_service=None), *****, Meta(creation_dt=datetime.datetime(2021, 11, 24, 22, 26, 59, tzinfo=<UTC>), creation_host='*****'))>
2021-11-25 21:18:04,008:DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/directory.
2021-11-25 21:18:04,010:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org:443
2021-11-25 21:18:04,489:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "GET /directory HTTP/1.1" 200 658
2021-11-25 21:18:04,491:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Date: Thu, 25 Nov 2021 20:18:04 GMT
Content-Type: application/json
Content-Length: 658
Connection: keep-alive
Cache-Control: public, max-age=0, no-cache
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
{
"HgGq9-KQs_w": "https://community.letsencrypt.org/t/adding-random-entries-to-the-directory/33417",
"keyChange": "https://acme-v02.api.letsencrypt.org/acme/key-change",
"meta": {
"caaIdentities": [
"letsencrypt.org"
],
"termsOfService": "https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf",
"website": "https://letsencrypt.org"
},
"newAccount": "https://acme-v02.api.letsencrypt.org/acme/new-acct",
"newNonce": "https://acme-v02.api.letsencrypt.org/acme/new-nonce",
"newOrder": "https://acme-v02.api.letsencrypt.org/acme/new-order",
"revokeCert": "https://acme-v02.api.letsencrypt.org/acme/revoke-cert"
}
2021-11-25 21:18:04,493:INFO:certbot.main:Obtaining a new certificate
2021-11-25 21:18:04,525:DEBUG:certbot.crypto_util:Generating key (2048 bits): /etc/letsencrypt/keys/0036_key-certbot.pem
2021-11-25 21:18:04,529:DEBUG:certbot.crypto_util:Creating CSR: /etc/letsencrypt/csr/0036_csr-certbot.pem
2021-11-25 21:18:04,530:DEBUG:acme.client:Requesting fresh nonce
2021-11-25 21:18:04,530:DEBUG:acme.client:Sending HEAD request to https://acme-v02.api.letsencrypt.org/acme/new-nonce.
2021-11-25 21:18:04,747:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "HEAD /acme/new-nonce HTTP/1.1" 200 0
2021-11-25 21:18:04,749:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Date: Thu, 25 Nov 2021 20:18:04 GMT
Connection: keep-alive
Cache-Control: public, max-age=0, no-cache
Link: <https://acme-v02.api.letsencrypt.org/directory>;rel="index"
Replay-Nonce: *****
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
2021-11-25 21:18:04,749:DEBUG:acme.client:Storing nonce: *****
2021-11-25 21:18:04,750:DEBUG:acme.client:JWS payload:
b'{\n "identifiers": [\n {\n "type": "dns",\n "value": "*.example.com"\n }\n ]\n}'
2021-11-25 21:18:04,757:DEBUG:acme.client:Sending POST request to https://acme-v02.api.letsencrypt.org/acme/new-order:
{
"protected": "*****",
"signature": "*****",
"payload": "*****"
}
2021-11-25 21:18:05,475:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "POST /acme/new-order HTTP/1.1" 201 338
2021-11-25 21:18:05,476:DEBUG:acme.client:Received response:
HTTP 201
Server: nginx
Date: Thu, 25 Nov 2021 20:18:05 GMT
Content-Type: application/json
Content-Length: 338
Connection: keep-alive
Boulder-Requester: *****
Cache-Control: public, max-age=0, no-cache
Link: <https://acme-v02.api.letsencrypt.org/directory>;rel="index"
Location: https://acme-v02.api.letsencrypt.org/acme/order/*****/*****
Replay-Nonce: *****
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
{
"status": "pending",
"expires": "2021-12-02T20:18:05Z",
"identifiers": [
{
"type": "dns",
"value": "*.example.com"
}
],
"authorizations": [
"https://acme-v02.api.letsencrypt.org/acme/authz-v3/*****"
],
"finalize": "https://acme-v02.api.letsencrypt.org/acme/finalize/*****/*****"
}
2021-11-25 21:18:05,477:DEBUG:acme.client:Storing nonce: *****
2021-11-25 21:18:05,478:DEBUG:acme.client:JWS payload:
b''
2021-11-25 21:18:05,484:DEBUG:acme.client:Sending POST request to https://acme-v02.api.letsencrypt.org/acme/authz-v3/*****:
{
"protected": "*****",
"signature": "*****",
"payload": ""
}
2021-11-25 21:18:06,101:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "POST /acme/authz-v3/***** HTTP/1.1" 200 386
2021-11-25 21:18:06,103:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Date: Thu, 25 Nov 2021 20:18:06 GMT
Content-Type: application/json
Content-Length: 386
Connection: keep-alive
Boulder-Requester: *****
Cache-Control: public, max-age=0, no-cache
Link: <https://acme-v02.api.letsencrypt.org/directory>;rel="index"
Replay-Nonce: *****
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
{
"identifier": {
"type": "dns",
"value": "example.com"
},
"status": "pending",
"expires": "2021-12-02T20:18:05Z",
"challenges": [
{
"type": "dns-01",
"status": "pending",
"url": "https://acme-v02.api.letsencrypt.org/acme/chall-v3/*****/*****",
"token": "*****"
}
],
"wildcard": true
}
2021-11-25 21:18:06,103:DEBUG:acme.client:Storing nonce: *****
2021-11-25 21:18:06,104:INFO:certbot.auth_handler:Performing the following challenges:
2021-11-25 21:18:06,105:INFO:certbot.auth_handler:dns-01 challenge for example.com
2021-11-25 21:18:06,106:WARNING:certbot.plugins.dns_common:Unsafe permissions on credentials configuration file: FILE_LOCATION
2021-11-25 21:18:06,110:INFO:googleapiclient.discovery:URL being requested: GET https://www.googleapis.com/discovery/v1/apis/dns/v1/rest
2021-11-25 21:18:06,400:INFO:googleapiclient.discovery:URL being requested: GET https://dns.googleapis.com/dns/v1/projects/*****/managedZones?dnsName=example.com.&alt=json
2021-11-25 21:18:06,401:INFO:oauth2client.transport:Attempting refresh to obtain initial access_token
2021-11-25 21:18:06,403:INFO:oauth2client.client:Refreshing access_token
2021-11-25 21:18:06,796:DEBUG:certbot_dns_google.dns_google:Found id of ***** for example.com using name example.com
2021-11-25 21:18:06,800:INFO:googleapiclient.discovery:URL being requested: GET https://dns.googleapis.com/dns/v1/projects/*****/managedZones/*****/rrsets?alt=json
2021-11-25 21:18:06,998:INFO:googleapiclient.discovery:URL being requested: POST https://dns.googleapis.com/dns/v1/projects/*****/managedZones/*****/changes?alt=json
2021-11-25 21:18:07,676:INFO:googleapiclient.discovery:URL being requested: GET https://dns.googleapis.com/dns/v1/projects/*****/managedZones/*****/changes/46?alt=json
2021-11-25 21:18:07,894:INFO:certbot.plugins.dns_common:Waiting 120 seconds for DNS changes to propagate
2021-11-25 21:20:07,995:INFO:certbot.auth_handler:Waiting for verification...
2021-11-25 21:20:07,996:DEBUG:acme.client:JWS payload:
b'{\n "resource": "challenge",\n "type": "dns-01"\n}'
2021-11-25 21:20:08,008:DEBUG:acme.client:Sending POST request to https://acme-v02.api.letsencrypt.org/acme/chall-v3/*****/*****:
{
"protected": "*****",
"signature": "*****",
"payload": "*****"
}
2021-11-25 21:20:08,782:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "POST /acme/chall-v3/*****/***** HTTP/1.1" 200 185
2021-11-25 21:20:08,784:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Date: Thu, 25 Nov 2021 20:20:08 GMT
Content-Type: application/json
Content-Length: 185
Connection: keep-alive
Boulder-Requester: *****
Cache-Control: public, max-age=0, no-cache
Link: <https://acme-v02.api.letsencrypt.org/directory>;rel="index", <https://acme-v02.api.letsencrypt.org/acme/authz-v3/*****>;rel="up"
Location: https://acme-v02.api.letsencrypt.org/acme/chall-v3/*****/*****
Replay-Nonce: *****
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
{
"type": "dns-01",
"status": "pending",
"url": "https://acme-v02.api.letsencrypt.org/acme/chall-v3/*****/*****",
"token": "*****"
}
2021-11-25 21:20:08,784:DEBUG:acme.client:Storing nonce: *****
2021-11-25 21:20:09,786:DEBUG:acme.client:JWS payload:
b''
2021-11-25 21:20:09,793:DEBUG:acme.client:Sending POST request to https://acme-v02.api.letsencrypt.org/acme/authz-v3/*****:
{
"protected": "*****",
"signature": "*****",
"payload": ""
}
2021-11-25 21:20:11,326:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "POST /acme/authz-v3/***** HTTP/1.1" 200 668
2021-11-25 21:20:11,327:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Date: Thu, 25 Nov 2021 20:20:11 GMT
Content-Type: application/json
Content-Length: 668
Connection: keep-alive
Boulder-Requester: *****
Cache-Control: public, max-age=0, no-cache
Link: <https://acme-v02.api.letsencrypt.org/directory>;rel="index"
Replay-Nonce: *****
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
{
"identifier": {
"type": "dns",
"value": "example.com"
},
"status": "invalid",
"expires": "2021-12-02T20:18:05Z",
"challenges": [
{
"type": "dns-01",
"status": "invalid",
"error": {
"type": "urn:ietf:params:acme:error:dns",
"detail": "DNS problem: NXDOMAIN looking up TXT for _acme-challenge.example.com - check that a DNS record exists for this domain",
"status": 400
},
"url": "https://acme-v02.api.letsencrypt.org/acme/chall-v3/*****/*****",
"token": "*****",
"validated": "2021-11-25T20:20:08Z"
}
],
"wildcard": true
}
2021-11-25 21:20:11,328:DEBUG:acme.client:Storing nonce: *****
2021-11-25 21:20:11,329:WARNING:certbot.auth_handler:Challenge failed for domain example.com
2021-11-25 21:20:11,330:INFO:certbot.auth_handler:dns-01 challenge for example.com
2021-11-25 21:20:11,330:DEBUG:certbot.reporter:Reporting to user: The following errors were reported by the server:
Domain: example.com
Type: dns
Detail: DNS problem: NXDOMAIN looking up TXT for _acme-challenge.example.com - check that a DNS record exists for this domain
2021-11-25 21:20:11,331:DEBUG:certbot.error_handler:Encountered exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 91, in handle_authorizations
self._poll_authorizations(authzrs, max_retries, best_effort)
File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 180, in _poll_authorizations
raise errors.AuthorizationError('Some challenges have failed.')
certbot.errors.AuthorizationError: Some challenges have failed.
2021-11-25 21:20:11,331:DEBUG:certbot.error_handler:Calling registered functions
2021-11-25 21:20:11,331:INFO:certbot.auth_handler:Cleaning up challenges
2021-11-25 21:20:11,334:INFO:googleapiclient.discovery:URL being requested: GET https://www.googleapis.com/discovery/v1/apis/dns/v1/rest
2021-11-25 21:20:12,254:INFO:googleapiclient.discovery:URL being requested: GET https://dns.googleapis.com/dns/v1/projects/*****/managedZones?dnsName=example.com.&alt=json
2021-11-25 21:20:12,254:INFO:oauth2client.transport:Attempting refresh to obtain initial access_token
2021-11-25 21:20:12,256:INFO:oauth2client.client:Refreshing access_token
2021-11-25 21:20:12,832:DEBUG:certbot_dns_google.dns_google:Found id of ***** for example.com using name example.com
2021-11-25 21:20:12,836:INFO:googleapiclient.discovery:URL being requested: GET https://dns.googleapis.com/dns/v1/projects/*****/managedZones/*****/rrsets?alt=json
2021-11-25 21:20:13,009:INFO:googleapiclient.discovery:URL being requested: POST https://dns.googleapis.com/dns/v1/projects/*****/managedZones/*****/changes?alt=json
2021-11-25 21:20:13,628:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/bin/certbot", line 11, in <module>
load_entry_point('certbot==0.40.0', 'console_scripts', 'certbot')()
File "/usr/lib/python3/dist-packages/certbot/main.py", line 1382, in main
return config.func(config, plugins)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 1265, in certonly
lineage = _get_and_save_cert(le_client, config, domains, certname, lineage)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 121, in _get_and_save_cert
lineage = le_client.obtain_and_enroll_certificate(domains, certname)
File "/usr/lib/python3/dist-packages/certbot/client.py", line 417, in obtain_and_enroll_certificate
cert, chain, key, _ = self.obtain_certificate(domains)
File "/usr/lib/python3/dist-packages/certbot/client.py", line 348, in obtain_certificate
orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)
File "/usr/lib/python3/dist-packages/certbot/client.py", line 396, in _get_order_and_authorizations
authzr = self.auth_handler.handle_authorizations(orderr, best_effort)
File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 91, in handle_authorizations
self._poll_authorizations(authzrs, max_retries, best_effort)
File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 180, in _poll_authorizations
raise errors.AuthorizationError('Some challenges have failed.')
certbot.errors.AuthorizationError: Some challenges have failed.
After a long comment thread, we figured out the problem.
The OP is using Google Domains for the Authoritative Name Servers.
Certbot does not have a plugin for Google Domains DNS servers. Google Domains does not publish an API.
The solution is to manually create the required DNS resource records or switch to another supported DNS server such as Google Cloud DNS.

How to update data to a nested array in angular?

This is how my JSON file looks like :
{
"responseCode": 200,
"responseMessage": "" ,
"details": "{\"id\":1,\"name\":\"sss\",\"status\":\"status 1\",\"active\":true,\"createdAt\":\"Dec 4, 2019, 4:21:46 PM\",\"modifiedAt\":\"Dec 5, 2019, 10:21:09 AM\",\"description\":\"daddddddddddddd\",\"imagePath\":\"imagepath 1\",\"viewCount\":133,\"important\":1}",
"timestamp": 0
}
TS File:
ngOnInit() {
this.blog.getBlog(this.id).subscribe((data: {}) => {
this.blogData = JSON.parse(data['details']);
})
}
updateBlog() {
if(window.confirm('Are you sure, you want to update?')){
this.blog.UpdateBlog(this.id, this.blogData).subscribe(data => {
this.router.navigate(['/home/blogger'])
})
}
}
Service File :
UpdateBlog(id,blog): Observable<Blog> {
let body = JSON.stringify(blog);
console.log(blog)
return this.http.put<Blog>('blog/' + id, body, this.httpOptions)
.pipe(
retry(1),
catchError(this.handleError)
)
}
I am able to do operations such as Get,delete and create,But unable to update values to the below JSON format.How can i do that?
Below is the postman code under the send option :
PUT /api/blog/3 HTTP/1.1
Host: 13.234.196.102:8080
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJwcmF2aWwiLCJpYXQiOjE1NzU1NDk2NTEsImV4cCI6MTU3NTYzNjA1MX0.j9FBDckN2jfi3-LU5coVGRZfW3wQEBnGpF4MAZ2u_pH6MRdA2KU_xrZTvb1ki9DWTydQ8YTrAgYg2uMkKktn9A
User-Agent: PostmanRuntime/7.19.0
Accept: */*
Cache-Control: no-cache
Postman-Token: 7e19e28c-6dde-42e8-b9f2-c1546eb65825,82753b69-39ad-48a5-b5fd-552e07008594
Host: 13.234.196.102:8080
Accept-Encoding: gzip, deflate
Content-Length: 160
Connection: keep-alive
cache-control: no-cache
{
"name": "sss",
"description": "Thsh",
"imagePath": "imagepath 1",
"status": "status 1",
"active": true
}

Gmail API returning non-existent threads

I am using the gmail API to list threads, and I'm finding that some of the items that come back from users_threads->list cannot be found using users_threads->get. These items also cannot be seen via gmail's web UI.
I am using gmail's api explorer (https://developers.google.com/gmail/api/v1/reference/users/threads/list) to test listing threads.
My inbox is empty for the auth'd account.
The site makes a request like GET https://www.googleapis.com/gmail/v1/users/me/threads?labelIds=INBOX&key={YOUR_API_KEY} and returns this result set:
200 OK
cache-control: no-cache, no-store, max-age=0, must-revalidate
content-encoding: gzip
content-length: 287
content-type: application/json; charset=UTF-8
date: Wed, 08 Jul 2015 18:23:25 GMT
etag: "A_TI-e9NgLq0wln5q88xm3zdvSg/6meEdFVG8voZD7dqGr76UTURSRk"
expires: Fri, 01 Jan 1990 00:00:00 GMT
pragma: no-cache
server: GSE
vary: Origin, X-Origin
{
"threads": [
{
"id": "14a78517c954ec9c",
"snippet": "",
"historyId": "806722"
},
{
"id": "149daea953d5674e",
"snippet": "",
"historyId": "688170"
},
{
"id": "149d462f26b543db",
"snippet": "",
"historyId": "686319"
},
{
"id": "149ac0958a5b44e8",
"snippet": "",
"historyId": "657008"
},
{
"id": "149ac0c2caea09f7",
"snippet": "",
"historyId": "656272"
},
{
"id": "149ac08d36ce3087",
"snippet": "",
"historyId": "656263"
},
{
"id": "148e3ab2c048f49e",
"snippet": "",
"historyId": "491569"
},
{
"id": "147a123d780d44a7",
"snippet": "",
"historyId": "186314"
},
{
"id": "1478f8b6c004dddb",
"snippet": "",
"historyId": "178535"
},
{
"id": "1478cf683ca0dc8d",
"snippet": "",
"historyId": "177603"
},
{
"id": "14788aa2aba1f35a",
"snippet": "",
"historyId": "173433"
}
],
"resultSizeEstimate": 11
}
It seems to return 11 objects when I would expect 0.
Furthermore, if I use the threads->get api (https://developers.google.com/gmail/api/v1/reference/users/threads/get) on any of these items, I get the following response:
GET https://www.googleapis.com/gmail/v1/users/me/threads/1478cf683ca0dc8d?key={YOUR_API_KEY}
404 Not Found
cache-control: private, max-age=0
content-encoding: gzip
content-length: 120
content-type: application/json; charset=UTF-8
date: Wed, 08 Jul 2015 18:30:21 GMT
expires: Wed, 08 Jul 2015 18:30:21 GMT
server: GSE
vary: Origin, X-Origin
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
There seems to be a bug in the API. According to the support page I am supposed to direct all concerns to stackoverflow, using the gmail-api tag, which I have done.
If the consensus here at stackoverflow is that this is a product bug, I will submit an issue with the product team as I could not find any similar bug submitted yet.
Thanks for any help addressing this issue.
Its not a bug in API. threads.list() would return you all the email threads including the ones which have been deleted. You must be getting the 404 on the messages which have been deleted. If a message has been permanently deleted, it will still show up in threads.list() call and message.get() call will fail on such messages.
Hope this clears some air.

400 Bad Request Inserting an event in Google Calendar

I am using the Google Calendar API and I am trying to send a request to the API for inserting an event but I'm getting an error.
This is the request that I am sending:
POST https://www.googleapis.com/calendar/v3/calendars/riteshmehandiratta%40gmail.com/events?key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZQwHy_3OYLmXtZpSa5PIwnBO3hqLWolMXpTYiFOEtjlEmbxNrYn
X-JavaScript-User-Agent: Google APIs Explorer
{
"end": {
"date": "2/14/2007"
},
"start": {
"date": "2/14/2007"
},
"kind": "calendar#event",
"summary": "Hello World"
}
and the response I am getting is:
400 Bad Request
- Hide headers -
cache-control: private, max-age=0
content-encoding: gzip
content-length: 122
content-type: application/json; charset=UTF-8
date: Sat, 23 Mar 2013 17:36:22 GMT
expires: Sat, 23 Mar 2013 17:36:22 GMT
server: GSE
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
I am unable to figure out why I am getting a bad request error.
From what i can tell your date format is wrong, the API docs indicate:
The date, in the format "yyyy-mm-dd", if this is an all-day event.
You might want to use the 'Try it' form at the bottom of this page to first make sure your requests are valid:
https://developers.google.com/google-apps/calendar/v3/reference/events/insert#try-it
Good luck!
This is what I did (PHP):
//Passed in a GET variable name of 'date'
//Tells parser the current format
$dt = DateTime::createFromFormat("d/m/Y", $_GET['date']);
//Adding the event start date, modifying the format to suit googles encoding
$start->setDate($df->format("Y-m-d"));
The script snippet above is working for me.
Rohan is correct about their formatting condition.

Resources