Android - Appium click event is not working - appium-android

I am new to appium, Wrote sample program to open app and click event for icon
Test case is passed -> Splash screen is opened , but event is not fired.Sometime its working and most of the time it wont
Code Snippet:
WebElement phoneSignIn = new WebDriverWait(driver, 10).until(ExpectedConditions
.refreshed(ExpectedConditions.presenceOfElementLocated(By.id("com.xyz.xyz:id/primaryGoogleLoginButton"))));
Assert.assertTrue(phoneSignIn != null && phoneSignIn.isDisplayed(), "Phone SignIn Button is not displayed");
phoneSignIn.click();
Appium server log:
[HTTP] --> POST /wd/hub/session/388a407b-99f5-4eaf-8c9b-d6d948bb8851/element
[HTTP] {"using":"id","value":"com.xyz.xyz:id/primaryGoogleLoginButton"}
[debug] [W3C (388a407b)] Calling AppiumDriver.findElement() with args: ["id","com.xyz.xyz:id/primaryGoogleLoginButton","388a407b-99f5-4eaf-8c9b-d6d948bb8851"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [WD Proxy] Matched '/element' to command name 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/6067d30e-befe-4413-86c9-ed95af200bc1/element] with body: {"strategy":"id","selector":"com.xyz.xyz:id/primaryGoogleLoginButton","context":"","multiple":false}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"6067d30e-befe-4413-86c9-ed95af200bc1","value":{"ELEMENT":"6038c598-1fce-4613-80f2-30546c9a9510","element-6066-11e4-a52e-4f735466cecf":"6038c598-1fce-4613-80f2-30546c9a9510"}}
[debug] [W3C (388a407b)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"6038c598-1fce-4613-80f2-30546c9a9510","ELEMENT":"6038c598-1fce-4613-80f2-30546c9a9510"}
[HTTP] <-- POST /wd/hub/session/388a407b-99f5-4eaf-8c9b-d6d948bb8851/element 200 628 ms - 137
[HTTP]
[HTTP] --> GET /wd/hub/session/388a407b-99f5-4eaf-8c9b-d6d948bb8851/element/6038c598-1fce-4613-80f2-30546c9a9510/displayed
[HTTP] {}
[debug] [W3C (388a407b)] Calling AppiumDriver.elementDisplayed() with args: ["6038c598-1fce-4613-80f2-30546c9a9510","388a407b-99f5-4eaf-8c9b-d6d948bb8851"]
[debug] [WD Proxy] Matched '/element/6038c598-1fce-4613-80f2-30546c9a9510/attribute/displayed' to command name 'getAttribute'
[debug] [WD Proxy] Proxying [GET /element/6038c598-1fce-4613-80f2-30546c9a9510/attribute/displayed] to [GET http://127.0.0.1:8200/wd/hub/session/6067d30e-befe-4413-86c9-ed95af200bc1/element/6038c598-1fce-4613-80f2-30546c9a9510/attribute/displayed] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"6067d30e-befe-4413-86c9-ed95af200bc1","value":"true"}
[debug] [W3C (388a407b)] Responding to client with driver.elementDisplayed() result: true
[HTTP] <-- GET /wd/hub/session/388a407b-99f5-4eaf-8c9b-d6d948bb8851/element/6038c598-1fce-4613-80f2-30546c9a9510/displayed 200 17 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/388a407b-99f5-4eaf-8c9b-d6d948bb8851/element/6038c598-1fce-4613-80f2-30546c9a9510/click
[HTTP] {"id":"6038c598-1fce-4613-80f2-30546c9a9510"}
[debug] [W3C (388a407b)] Calling AppiumDriver.click() with args: ["6038c598-1fce-4613-80f2-30546c9a9510","388a407b-99f5-4eaf-8c9b-d6d948bb8851"]
[debug] [WD Proxy] Matched '/element/6038c598-1fce-4613-80f2-30546c9a9510/click' to command name 'click'
[debug] [WD Proxy] Proxying [POST /element/6038c598-1fce-4613-80f2-30546c9a9510/click] to [POST http://127.0.0.1:8200/wd/hub/session/6067d30e-befe-4413-86c9-ed95af200bc1/element/6038c598-1fce-4613-80f2-30546c9a9510/click] with body: {"element":"6038c598-1fce-4613-80f2-30546c9a9510"}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"6067d30e-befe-4413-86c9-ed95af200bc1","value":null}
[debug] [W3C (388a407b)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/388a407b-99f5-4eaf-8c9b-d6d948bb8851/element/6038c598-1fce-4613-80f2-30546c9a9510/click 200 646 ms - 14
[HTTP]
Any help appreciated!

Related

helm pull from artifact registry fails after successfull login (in 90% of cases)

I am trying to pull a package from Google's Artifact Registry following this documentation.
After the successful login helm pull fails with Error: failed to authorize: failed to fetch anonymous token: unexpected status: 403 Forbidden but sometimes it succeeds. I wasn't able to figure out how and why. Service account, which key I am using, has all required permissions.
Here is the full log (successful):
cat key.json | helm registry --debug login -u _json_key_base64 --password-stdin https://europe-west3-docker.pkg.dev/engineering-368717/helm-registry && helm pull --debug oci://europe-west3-docker.pkg.dev/engineering-368717/helm-registry/staging/email-service --version 0.1.0
Login Succeeded
DEBU[0000] resolving host=europe-west3-docker.pkg.dev
DEBU[0000] do request host=europe-west3-docker.pkg.dev request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=Helm/3.10.3 request.method=HEAD url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/0.1.0"
DEBU[0000] fetch response received host=europe-west3-docker.pkg.dev response.header.alt-svc="h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" response.header.content-length=102 response.header.content-type=application/json response.header.date="Fri, 20 Jan 2023 15:26:39 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.www-authenticate="Bearer realm=\"https://europe-west3-docker.pkg.dev/v2/token\",service=\"europe-west3-docker.pkg.dev\",scope=\"repository:engineering-368717/helm-registry/staging/email-service:pull\"" response.header.x-content-type-options=nosniff response.header.x-frame-options=SAMEORIGIN response.header.x-xss-protection=0 response.status="401 Unauthorized" url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/0.1.0"
DEBU[0000] Unauthorized header="Bearer realm=\"https://europe-west3-docker.pkg.dev/v2/token\",service=\"europe-west3-docker.pkg.dev\",scope=\"repository:engineering-368717/helm-registry/staging/email-service:pull\"" host=europe-west3-docker.pkg.dev
DEBU[0000] do request host=europe-west3-docker.pkg.dev request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=Helm/3.10.3 request.method=HEAD url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/0.1.0"
DEBU[0000] fetch response received host=europe-west3-docker.pkg.dev response.header.alt-svc="h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" response.header.content-length=353 response.header.content-type=application/vnd.oci.image.manifest.v1+json response.header.date="Fri, 20 Jan 2023 15:26:39 GMT" response.header.docker-content-digest="sha256:28b201f65198b6f5ecc401c6c58ccd5767bb89c619b288aa9b606ade4500d4dc" response.header.docker-distribution-api-version=registry/2.0 response.status="200 OK" url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/0.1.0"
DEBU[0000] resolved desc.digest="sha256:28b201f65198b6f5ecc401c6c58ccd5767bb89c619b288aa9b606ade4500d4dc" host=europe-west3-docker.pkg.dev
DEBU[0000] do request digest="sha256:28b201f65198b6f5ecc401c6c58ccd5767bb89c619b288aa9b606ade4500d4dc" request.header.accept="application/vnd.oci.image.manifest.v1+json, */*" request.header.user-agent=Helm/3.10.3 request.method=GET url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/sha256:28b201f65198b6f5ecc401c6c58ccd5767bb89c619b288aa9b606ade4500d4dc"
DEBU[0000] fetch response received digest="sha256:28b201f65198b6f5ecc401c6c58ccd5767bb89c619b288aa9b606ade4500d4dc" response.header.alt-svc="h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" response.header.content-length=353 response.header.content-type=application/vnd.oci.image.manifest.v1+json response.header.date="Fri, 20 Jan 2023 15:26:39 GMT" response.header.docker-content-digest="sha256:28b201f65198b6f5ecc401c6c58ccd5767bb89c619b288aa9b606ade4500d4dc" response.header.docker-distribution-api-version=registry/2.0 response.header.x-content-type-options=nosniff response.header.x-frame-options=SAMEORIGIN response.header.x-xss-protection=0 response.status="200 OK" url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/sha256:28b201f65198b6f5ecc401c6c58ccd5767bb89c619b288aa9b606ade4500d4dc"
DEBU[0000] do request digest="sha256:7404113340c566b9200059ba22aa8f8074d299794b2178c7efc309fa8c34222c" request.header.accept="application/vnd.cncf.helm.chart.content.v1.tar+gzip, */*" request.header.user-agent=Helm/3.10.3 request.method=GET url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/blobs/sha256:7404113340c566b9200059ba22aa8f8074d299794b2178c7efc309fa8c34222c"
DEBU[0000] do request digest="sha256:2083e87173b09ed1d66ac5d35b08dfe581f7c2f938cc2f4f045eb8b98b410abe" request.header.accept="application/vnd.cncf.helm.config.v1+json, */*" request.header.user-agent=Helm/3.10.3 request.method=GET url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/blobs/sha256:2083e87173b09ed1d66ac5d35b08dfe581f7c2f938cc2f4f045eb8b98b410abe"
DEBU[0000] fetch response received digest="sha256:2083e87173b09ed1d66ac5d35b08dfe581f7c2f938cc2f4f045eb8b98b410abe" response.header.accept-ranges=bytes response.header.alt-svc="h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" response.header.content-length=137 response.header.content-type=application/octet-stream response.header.date="Fri, 20 Jan 2023 15:26:40 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.x-content-type-options=nosniff response.header.x-frame-options=SAMEORIGIN response.header.x-xss-protection=0 response.status="200 OK" url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/blobs/sha256:2083e87173b09ed1d66ac5d35b08dfe581f7c2f938cc2f4f045eb8b98b410abe"
DEBU[0000] encountered unknown type application/vnd.cncf.helm.config.v1+json; children may not be fetched
DEBU[0000] fetch response received digest="sha256:7404113340c566b9200059ba22aa8f8074d299794b2178c7efc309fa8c34222c" response.header.accept-ranges=bytes response.header.alt-svc="h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" response.header.cache-control="private, max-age=0" response.header.content-length=3952 response.header.content-type=application/octet-stream response.header.date="Fri, 20 Jan 2023 15:26:40 GMT" response.header.expires="Fri, 20 Jan 2023 15:26:40 GMT" response.header.server=UploadServer response.header.x-goog-hash="crc32c=DYoQ4w==" response.header.x-guploader-uploadid=ADPycdu3XwUND8_8d27U5Rr9aO6e0RnD3yT6M_lbQXZvdK5Yf2bwEbsUVl9h7PZ6r26MBH0qBYV9uakQT2EqfRVBOYQuej5StMOT response.status="200 OK" url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/blobs/sha256:7404113340c566b9200059ba22aa8f8074d299794b2178c7efc309fa8c34222c"
DEBU[0000] encountered unknown type application/vnd.cncf.helm.chart.content.v1.tar+gzip; children may not be fetched
Pulled: europe-west3-docker.pkg.dev/engineering-368717/helm-registry/staging/email-service:0.1.0
Digest: sha256:28b201f65198b6f5ecc401c6c58ccd5767bb89c619b288aa9b606ade4500d4dc
And unsuccessful:
cat key.json | helm registry --debug login -u _json_key_base64 --password-stdin https://europe-west3-docker.pkg.dev/engineering-368717/helm-registry && helm pull --debug oci://europe-west3-docker.pkg.dev/engineering-368717/helm-registry/staging/email-service --version 0.1.0
Login Succeeded
DEBU[0000] resolving host=europe-west3-docker.pkg.dev
DEBU[0000] do request host=europe-west3-docker.pkg.dev request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=Helm/3.10.3 request.method=HEAD url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/0.1.0"
DEBU[0000] fetch response received host=europe-west3-docker.pkg.dev response.header.alt-svc="h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" response.header.content-length=102 response.header.content-type=application/json response.header.date="Fri, 20 Jan 2023 15:26:43 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.www-authenticate="Bearer realm=\"https://europe-west3-docker.pkg.dev/v2/token\",service=\"europe-west3-docker.pkg.dev\",scope=\"repository:engineering-368717/helm-registry/staging/email-service:pull\"" response.header.x-content-type-options=nosniff response.header.x-frame-options=SAMEORIGIN response.header.x-xss-protection=0 response.status="401 Unauthorized" url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/0.1.0"
DEBU[0000] Unauthorized header="Bearer realm=\"https://europe-west3-docker.pkg.dev/v2/token\",service=\"europe-west3-docker.pkg.dev\",scope=\"repository:engineering-368717/helm-registry/staging/email-service:pull\"" host=europe-west3-docker.pkg.dev
DEBU[0000] do request host=europe-west3-docker.pkg.dev request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=Helm/3.10.3 request.method=HEAD url="https://europe-west3-docker.pkg.dev/v2/engineering-368717/helm-registry/staging/email-service/manifests/0.1.0"
INFO[0000] trying next host error="failed to authorize: failed to fetch anonymous token: unexpected status: 403 Forbidden" host=europe-west3-docker.pkg.dev
Error: failed to authorize: failed to fetch anonymous token: unexpected status: 403 Forbidden
helm.go:84: [debug] failed to authorize: failed to fetch anonymous token: unexpected status: 403 Forbidden
Output of helm version:
version.BuildInfo{Version:"v3.10.3", GitCommit:"835b7334cfe2e5e27870ab3ed4135f136eecc704", GitTreeState:"clean", GoVersion:"go1.18.9"}
Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.8", GitCommit:"fdc77503e954d1ee641c0e350481f7528e8d068b", GitTreeState:"clean", BuildDate:"2022-11-09T13:38:19Z", GoVersion:"go1.18.8", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.7-gke.900", GitCommit:"e35c4457f66187eff006dda6d2c0fe12144ef2ec", GitTreeState:"clean", BuildDate:"2022-10-26T09:25:34Z", GoVersion:"go1.18.7b7", Compiler:"gc", Platform:"linux/amd64"}
The final result I expect is ArgoCD installing helm packages from ArtifactRegistry. However it fails with the same error as locally.

RESTHeart Error When Trying To Load CSV Data

I try to load csv data by using:
given().
contentType("text/csv").
body("num,name,val\n1,dror,x\n2,amir,y").
when().
log ().
all ().
post("csv?db=restheart&coll=poi&id=0").
then().log().ifError()
I get status 400:
"message": "Content-Type request header must be 'text/csv'"
although the header seems right:
Content-Type=text/csv; charset=ISO-8859-1
full log following:
Request path: http://localhost:8080/csv?db=restheart&coll=poi&id=0
Proxy: <none>
Request params: <none>
Query params: <none>
Form params: <none>
Path params: <none>
Multiparts: <none>
Headers: Accept=*/*
Content-Type=text/csv; charset=ISO-8859-1
Cookies: <none>
Body:
num,name,val
1,dror,x
2,amir,y
HTTP/1.1 400 Bad Request
Content-Encoding: gzip
X-Powered-By: restheart.org
Auth-Token-Location: /tokens/admin
Authentication-Info: nextnonce="moqjKcH05wkNMTU4NTk1NDY2OTEwNe2jU1Xuay1TK5O7rrmyiDA=",qop="auth",rspauth="d31b66e99f7dbb1c339b17741f9380c5",cnonce="f1843d31ec429268",nc=00000001
Access-Control-Expose-Headers: Location, ETag, X-Powered-By, Auth-Token, Auth-Token-Valid-Until, Auth-Token-Location
Date: Fri, 03 Apr 2020 22:57:49 GMT
Auth-Token: 16p0go30vzwa3ju0h839zn4wfnipcy914g56b5t0xkjh9yotxa
Connection: keep-alive
Access-Control-Allow-Origin: *
Auth-Token-Valid-Until: 2020-04-03T23:12:49.109466Z
Access-Control-Allow-Credentials: true
Content-Type: application/json
Content-Length: 142
{
"http status code": 400,
"http status description": "Bad Request",
"message": "Content-Type request header must be 'text/csv'",
"_links": {
"self": {
"href": "/csv"
}
}
}
Any idea what is going wrong?
I checked the code of the CsvLoader service (that handles the request) and it checks Content-Type to be exactly text/csv, so I think the problem is with the additional charset substring ; charset=ISO-8859-1
Force the Content-Type header to be exactly just text-cvs.
I also fixed this bug (see commit 47fa0821). Fix will be included in upcoming v5.0 release.

Downloading data from REST API response but getting a response code of -1

REST API details from documentation:
GET /REST/sql_snapshot/2003-03-01.sql.gz HTTP/1.1
Host: some.api.net
Authorization: Basic qpow3i12o3
The response shown below omits the message body, which contains binary compressed SQL data.
HTTP/1.1 200 OK
Date: Wed, 05 Mar 2003 10:19:46 GMT
Server: Apache/1.3.22 (Unix) (Red-Hat/Linux)Content-Type: application/octet-stream
I'm getting a response code of -1 from below.
URL url = new URL("https://some.api.net/REST/sql_snapshot/2003-03-01.sql.gz");
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("Content-Type", "application/octet-stream");
connection.setDoOutput(true);
connection.connect();

Unexpected character in payload

My Citrus test sends a (travel)request to some REST API. The response is handled as follows:
http()
.client("http://localhost:18082/cases")
.send()
.post()
.accept("application/json; charset=UTF-8")
.contentType("application/json")
//.payload(new ClassPathResource("templates/travelrequest.json"));
.payload(
"{ "+
"\"definition\": \"travelrequest.xml\", "+
"\"name\": \"travelrequest\" "+
"} "
);
Although response code 500 is received, this is what I expect. In Wireshark I captured the following package:
Host: localhost:18082
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
Accept-Encoding: gzip,deflate
{ "definition": "travelrequest.xml", "name": "travelrequest" } HTTP/1.1 500 Internal Server Error
Server: spray-can/1.3.3
Date: Thu, 13 Apr 2017 15:33:37 GMT
When I move the payload to a template, the receive part of my test now looks like this:
http()
.client("http://localhost:18082/cases")
.send()
.post()
.accept("application/json; charset=UTF-8")
.contentType("application/json")
.payload(new ClassPathResource("templates/travelrequest.json"));
//.payload(
// "{ "+
// "\"definition\": \"travelrequest.xml\", "+
// "\"name\": \"travelrequest\" "+
// "} "
//);
The template resource contains this text:
{
"definition": "travelrequest.xml",
"name": "travelrequest"
}
When I run this test, I receive a different response code: 400. In Wireshark I captured the following package:
Host: localhost:18082
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
Accept-Encoding: gzip,deflate
?{
"definition": "travelrequest.xml",
"name": "travelrequest"
}HTTP/1.1 400 Bad Request
Server: spray-can/1.3.3
Date: Thu, 13 Apr 2017 15:36:15 GMT
Do notice that the request starts with an unexpected questionmark. This questionmark is not visible in the Citrus output:
17:36:13,629 DEBUG client.HttpClient| Sending HTTP message to: 'http://localhost:18082/cases'
17:36:13,629 DEBUG client.HttpClient| Message to send:
{
"definition": "travelrequest.xml",
"name": "travelrequest"
}
17:36:13,630 DEBUG ingClientInterceptor| Sending Http request message
Do notice the space directly before the opening bracket.
Is this some special character? Why is it added to the payload? Is there a logical explanation?
Cheers,
Ed
Seems to be an encoding issue. Citrus by default uses UTF-8 encoding when reading the file content. Maybe the file uses some other encoding and the first character is the result of this difference.
Please check the file encoding. You can tell Citrus to use some other encoding by setting the System property
citrus.file.encoding=UTF-8
You can also add this property to the citrus-application.properties file as described here: http://www.citrusframework.org/reference/html/configuration.html#citrus-application-properties

AWS SDK for iOS didFailWithError not called when exceptions are off

when I setup my S3 like that
#property (nonatomic, strong) S3TransferManager *tm;
.
.
[AmazonErrorHandler shouldNotThrowExceptions];
[AmazonLogger verboseLogging];
self.tm = [S3TransferManager new];
self.tm.s3 = self.s3;
self.tm.delegate = self;
and then use
request = .......
S3TransferOperation * op = [self.tm download:request];
when I fetch a file that exists on my S3 account, the callback gets called fine
-(void)request:(AmazonServiceRequest *)request didCompleteWithResponse:(AmazonServiceResponse *)response
but when I try to fetch a file that does not exits, the callback does not get called
-(void)request:(AmazonServiceRequest *)request didFailWithError:(NSError *)error
if I remove
// [AmazonErrorHandler shouldNotThrowExceptions];
then I have a different problem, the exception is thrown, but despite me having a proper #try..#catch block in place, the app crashes
#try {
.
.
.
S3TransferOperation * op = [self.tm download:request];
} #catch (AmazonServiceException *exception) {
NSLog(#"========================>[S3 Module] ERROR, Unable to download file : %#", exception.error);
return NUMBOOL(NO);
} #catch (NSException * exception) {
NSLog(#"*************************[S3 Module] ERROR, Unable to download file : %#", exception);
return NUMBOOL(NO);
}
this is the AWS SDK verbose log when exception throwing is disabled
[DEBUG] 2013-12-01 23:25:16.243 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|443|Begin Request: S3GetObjectMetadataRequest
[DEBUG] 2013-12-01 23:25:16.246 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client signS3Request:]|646|In SignURLRequest: String to Sign = [HEAD
[DEBUG] application/x-www-form-urlencoded; charset=utf-8
[DEBUG] Sun, 01 Dec 2013 21:25:16 GMT
[DEBUG] /hello-XXX/NDAb.pdf]
[DEBUG] 2013-12-01 23:25:16.247 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|462|HEAD https://hello-XXX.s3.amazonaws.com/NDAb.pdf?
[DEBUG] 2013-12-01 23:25:16.248 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|463|Request headers:
[DEBUG] 2013-12-01 23:25:16.249 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|466| Date: Sun, 01 Dec 2013 21:25:16 GMT
[DEBUG] 2013-12-01 23:25:16.250 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|466| Content-Length: 0
[DEBUG] 2013-12-01 23:25:16.250 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|466| Authorization: AWS AKXXXXXW3YSTRRZAR4JPA:XXXXSAWELv5xAAR/mxXXXXVVJ2tr=
[DEBUG] 2013-12-01 23:25:16.251 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|466| User-Agent: Transfer Manager, aws-sdk-iOS/1.7.0 iPhone-OS/7.0 en_US NE
[DEBUG] 2013-12-01 23:25:16.252 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|466| Content-Type: application/x-www-form-urlencoded; charset=utf-8
[DEBUG] 2013-12-01 23:25:16.252 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|466| Host: hello-XXXXX.s3.amazonaws.com
[DEBUG] 2013-12-01 23:25:16.253 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|468|Request body:
[DEBUG] 2013-12-01 23:25:16.254 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|470|
[DEBUG] 2013-12-01 23:25:17.840 Ti-AWS-S3[84675:a0b] S3Response.m|-[S3Response connectionDidFinishLoading:]|182|Response:
[DEBUG] 2013-12-01 23:25:17.841 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|521|Response Status Code : 404
[DEBUG] 2013-12-01 23:25:17.842 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|530|Request threw exception: AmazonServiceException { RequestId:(null), ErrorCode:(null), Message:(null) }
[DEBUG] 2013-12-01 23:25:17.842 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|532|HTTP: 404, S3 Error Code: (null)
[DEBUG] 2013-12-01 23:25:17.843 Ti-AWS-S3[84675:a0b] AmazonS3Client.m|-[AmazonS3Client invoke:]|534|Reason: (null)
as you can see, my callbacks are not fired.
is it something I am doing wrong? or is this a bug with the AWS SDK?
We released version 1.7.1 of the AWS SDK for iOS that includes a couple of fixes related to S3TransferManager, including the issue you noted here. You can read more about the other feature enhancements and bug fixes in the release note.