Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to send attachment using Signal-android #7

Open
manojshinde opened this issue Oct 14, 2016 · 1 comment
Open

Not able to send attachment using Signal-android #7

manojshinde opened this issue Oct 14, 2016 · 1 comment

Comments

@manojshinde
Copy link

10-14 17:31:53.645 13150-14116/org.thoughtcrime.securesms W/PushServiceSocket: Push service URL: http://192.168.1.102:5665
10-14 17:31:53.646 13150-14116/org.thoughtcrime.securesms W/PushServiceSocket: Opening URL: http://192.168.1.102:5665/v1/attachments/
10-14 17:31:53.662 13150-14116/org.thoughtcrime.securesms W/PushServiceSocket: Got attachment content location: https://signalbucketmtech.s3.amazonaws.com/2310449486897847259?AWSAccessKeyId=AKIAITENYGFRZFH6YIWA&Expires=1476450048&Signature=KH63Pfe%2FcpDkWA4wGvfCe178XVw%3D
10-14 17:31:54.167 13150-14116/org.thoughtcrime.securesms W/PushMediaSendJob: java.io.IOException: Bad response: 400 Bad Request
at org.whispersystems.textsecure.internal.push.PushServiceSocket.uploadAttachment(PushServiceSocket.java:482)
at org.whispersystems.textsecure.internal.push.PushServiceSocket.sendAttachment(PushServiceSocket.java:360)
at org.whispersystems.textsecure.api.TextSecureMessageSender.createAttachmentPointer(TextSecureMessageSender.java:358)
at org.whispersystems.textsecure.api.TextSecureMessageSender.createAttachmentPointers(TextSecureMessageSender.java:341)
at org.whispersystems.textsecure.api.TextSecureMessageSender.createMessageContent(TextSecureMessageSender.java:186)
at org.whispersystems.textsecure.api.TextSecureMessageSender.sendMessage(TextSecureMessageSender.java:123)
at org.thoughtcrime.securesms.jobs.PushMediaSendJob.deliver(PushMediaSendJob.java:127)
at org.thoughtcrime.securesms.jobs.PushMediaSendJob.onSend(PushMediaSendJob.java:69)
at org.thoughtcrime.securesms.jobs.SendJob.onRun(SendJob.java:43)
at org.thoughtcrime.securesms.jobs.MasterSecretJob.onRun(MasterSecretJob.java:18)
at org.whispersystems.jobqueue.JobConsumer.runJob(JobConsumer.java:76)
at org.whispersystems.jobqueue.JobConsumer.run(JobConsumer.java:46)
10-14 17:31:54.167 13150-14116/org.thoughtcrime.securesms W/JobConsumer: org.thoughtcrime.securesms.transport.RetryLaterException: java.io.IOException: Bad response: 400 Bad Request
at org.thoughtcrime.securesms.jobs.PushMediaSendJob.deliver(PushMediaSendJob.java:136)
at org.thoughtcrime.securesms.jobs.PushMediaSendJob.onSend(PushMediaSendJob.java:69)
at org.thoughtcrime.securesms.jobs.SendJob.onRun(SendJob.java:43)
at org.thoughtcrime.securesms.jobs.MasterSecretJob.onRun(MasterSecretJob.java:18)
at org.whispersystems.jobqueue.JobConsumer.runJob(JobConsumer.java:76)
at org.whispersystems.jobqueue.JobConsumer.run(JobConsumer.java:46)
Caused by: java.io.IOException: Bad response: 400 Bad Request
at org.whispersystems.textsecure.internal.push.PushServiceSocket.uploadAttachment(PushServiceSocket.java:482)
at org.whispersystems.textsecure.internal.push.PushServiceSocket.sendAttachment(PushServiceSocket.java:360)
at org.whispersystems.textsecure.api.TextSecureMessageSender.createAttachmentPointer(TextSecureMessageSender.java:358)
at org.whispersystems.textsecure.api.TextSecureMessageSender.createAttachmentPointers(TextSecureMessageSender.java:341)
at org.whispersystems.textsecure.api.TextSecureMessageSender.createMessageContent(TextSecureMessageSender.java:186)
at org.whispersystems.textsecure.api.TextSecureMessageSender.sendMessage(TextSecureMessageSender.java:123)

@cracautanu
Copy link

cracautanu commented Nov 16, 2016

Hi Manojshinde,

I have the upload working on Android on my side. Have you tried the exact steps from Luca? From what I see, your issue could be related to text secure server config file. The default port for push server is 9090. I run push and text secure server on the same server so in my case the config in text secure .yml file would be:

push: host: localhost port: 9090 username: 123 password: 123

Regarding the Amazon S3 bucket configuration:

  1. You need to set the correct configuration in yml file from text secure server:
    s3: accessKey: xxxx accessSecret: xxx attachmentsBucket: xxx
    If I remember well, you also need to regenerate the keys till you get them without special chars (only numbers and letters)

  2. Make sure you create your bucket in US Standard region. The signal code works with s3 signature v3 only. The other regions require signature V4 for presigned url requests and you will need to update the code.

  3. Still not done with this step but so far I got this: Go to S3 Console/Bucket/Properties/Permissions and add a CORS file with the config bellow. This will get you over cross domain http request error in signal desktop.

<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>HEAD</AllowedMethod> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>DELETE</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <AllowedHeader>*</AllowedHeader> </CORSRule> </CORSConfiguration>
Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants