getting error while doing ethereum transaction in flutter
I/flutter ( 4135): RPCError: got code -32000 with msg "invalid sender".
E/flutter ( 4135): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: RPCError: got code -32000 with msg "invalid sender".
Transaction(keys: credentials, maximumGas: _maximumGas)
.prepareForSimpleTransaction(
new EthereumAddress(
_to),
EtherAmount.fromUnitAndValue(
EtherUnit.ether, 1))
.send(Client());
Related
Dear appwrite community,
I implemented a simple sms verification for my flutter app. When I want to send a verification sms via text-magic, the appwrite messaging worker log the following error.
[notice] Starting work on (Job{v1-messaging} | ID: e8dbb2e55c8e618a1e31179d42f9a22f | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+123456789","message":"123456","events":["."]}])
[critical] (Job{v1-messaging} | ID: e8dbb2e55c8e618a1e31179d42f9a22f | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+123456789","message":"123456","events":["."]}]) has failed TypeError: strlen(): Argument #1 ($str) must be of type string, array given in /usr/src/code/vendor/utopia-php/messaging/src/Utopia/Messaging/Adapter.php:59
Stack trace:
#0 /usr/src/code/vendor/utopia-php/messaging/src/Utopia/Messaging/Adapters/SMS/TextMagic.php(54): Utopia\Messaging\Adapter->request('POST', 'https://rest.te...', Array, Array)
#1 /usr/src/code/vendor/utopia-php/messaging/src/Utopia/Messaging/Adapters/SMS.php(33): Utopia\Messaging\Adapters\SMS\TextMagic->process(Object(Utopia\Messaging\Messages\SMS))
#2 /usr/src/code/app/workers/messaging.php(69): Utopia\Messaging\Adapters\SMS->send(Object(Utopia\Messaging\Messages\SMS))
#3 /usr/src/code/src/Appwrite/Resque/Worker.php(121): MessagingV1->run()
#4 /usr/src/code/vendor/resque/php-resque/lib/Resque/Job.php(201): Appwrite\Resque\Worker->perform()
#5 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(303): Resque_Job->perform()
#6 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(242): Resque_Worker->perform(Object(Resque_Job))
#7 /usr/src/code/vendor/resque/php-resque/bin/resque(185): Resque_Worker->work('1', false)
#8 {main}
There is no sms send, but the user is created in my appwrite console.
I've setup the phoneSession like this.
startPhoneSession(String phone) async {
try {
_user ??= User();
if (account == null) {
_init();
}
var token =
await account!.createPhoneSession(userId: ID.unique(), phone: phone);
_user!.id = token.userId;
_storeUserId();
} catch (error) {
//Do something with the error...
print(error);
}
}
My .env variables are set like the docs say with the username and apikey from text-magic.
It feels like a issue with appwrite right? If you need anymore information feel free to ask :)
Cheers!
This does look like it might be a bug. The best place to report bugs would be Appwrite's GitHub repo. I would suggest creating an issue there.
I am using pyoidc as RP (relying party) to google OP. I have obtained client-id and client-secret out of band. Also the authorization request happens out of pyoidc and obtained the "QUERY_STRING" which contains authorization code grant along with few parameters.
Then i have instantiated "pyoidc client" object and filled with the above information. Now when i am invoking "client.do_access_token_request" to obtain ID Token and access token, i see from debugs, I have got the ID Token and AccessTokenResponse.
While validating the ID Token, my python client application is crashing with segmentation fault.
DEBUGS:
from https://www.googleapis.com/oauth2/v3/certs
DEBUG:oic.oauth2.message:Found signing key.
DEBUG:jwkest.jws:Picking key by key type=RSA
DEBUG:jwkest.jws:Picking key based on alg=RS256, kid=b6f8d55da534ea91cb2cb00e1af4e8e0cdeca93d and use=
DEBUG:jwkest.jws:Picked: kid:b6f8d55da534ea91cb2cb00e1af4e8e0cdeca93d, use:sig, kty:RSA
Segmentation fault
stacktrace:
Program received signal SIGSEGV, Segmentation fault.
sha_compress (hs=0x81cd698) at src/hash_SHA2_template.c:183
183 src/hash_SHA2_template.c: No such file or directory.
in src/hash_SHA2_template.c
(gdb) bt
#0 sha_compress (hs=0x81cd698) at src/hash_SHA2_template.c:183
#1 0x00a1e77a in SHA256_update (hs=0x81cd698, buf=<value optimized out>, len=574) at
src/hash_SHA2_template.c:366
#2 SHA256_update (hs=0x81cd698, buf=<value optimized out>, len=574) at
src/hash_SHA2_template.c:347
#3 0x009d744f in ffi_call_SYSV () at src/x86/sysv.S:61
#4 0x009d7280 in ffi_call (cif=0xf7b4df38, fn=0xa1e6f0 <SHA256_update>, rvalue=0xf76b4cf0,
avalue=0xf76b4ce0) at src/x86/ffi.c:213
#5 0x009c3dca in cdata_call (cd=0xf76400b0, args=0xf76427fc, kwds=0x0) at
c/_cffi_backend.c:3025
#6 0x0019fa34 in _PyObject_FastCallDict () from /usr/lib/libpython3.6m.so.1.0
I am new to Twilio and Angular!
I am creating a Twilio Client in Angular2 using Twilio Token which I am getting from the server. But I am getting below error.
I have already installed NuGet packages for Twilio-chat.
Code to create Twilio client.
const client = await Client.create(this.token);
Error
vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:2100 ERROR Error: Uncaught (in promise): Error: Can't connect to twilsock
Error: Can't connect to twilsock
at Upstream.send (upstream.js?6143:144)
at TwilsockClient.post (client.js?d83e:150)
at executeWithRetry (network.js?2fab:122)
at Retrier.retrier.on (network.js?2fab:78)
at Retrier.EventEmitter.emit (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:79200)
at Retrier.attempt (retrier.js?cc7c:28)
at timeout.setTimeout (retrier.js?cc7c:67)
at ZoneDelegate.invokeTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84187)
at Zone.runTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:83954)
at ZoneTask.invokeTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84262)
at ZoneTask.invoke (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84251)
at timer (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:85791)
at Upstream.send (upstream.js?6143:144)
at TwilsockClient.post (client.js?d83e:150)
at executeWithRetry (network.js?2fab:122)
at Retrier.retrier.on (network.js?2fab:78)
at Retrier.EventEmitter.emit (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:79200)
at Retrier.attempt (retrier.js?cc7c:28)
at timeout.setTimeout (retrier.js?cc7c:67)
at ZoneDelegate.invokeTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84187)
at Zone.runTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:83954)
at ZoneTask.invokeTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84262)
at ZoneTask.invoke (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84251)
at timer (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:85791)
at resolvePromise (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84575)
at resolvePromise (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84541)
at vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84624
at ZoneDelegate.invokeTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84187)
at Object.onInvokeTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:5392)
at ZoneDelegate.invokeTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84186)
at Zone.runTask (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:83954)
at drainMicroTaskQueue (vendor.js?v=Y21ivCkyOiPlokFTbKpKeeclguwnaH8po-6x_Nx58pI:84361)
I am getting an intermittent error when attempting to use the YouTube API to retrieve playlist and video information. I am using the PHP client. Here is the full error:
PHP Fatal error: Uncaught exception 'Google_IO_Exception' with message 'Couldn't resolve host 'www.googleapis.com'' in /Test/libs/google-api-php-client-master/src/Google/IO/Curl.php:115
Stack trace:
#0 /Test/libs/google-api-php-client-master/src/Google/IO/Abstract.php(136): Google_IO_Curl->executeRequest(Object(Google_Http_Request))
#1 /Test/libs/google-api-php-client-master/src/Google/Http/REST.php(60): Google_IO_Abstract->makeRequest(Object(Google_Http_Request))
#2 [internal function]: Google_Http_REST::doExecute(Object(Google_Client), Object(Google_Http_Request))
#3 /Test/libs/google-api-php-client-master/src/Google/Task/Runner.php(174): call_user_func_array(Array, Array)
#4 /Test/libs/google-api-php-client-master/src/Google/Http/REST.php(46): Google_Task_Runner->run()
#5 /Test/libs/google-api-php-client-master/src/Google/Client.php(590): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request))
#6 /Test/libs/google-api-php-client-master/src/Google/Service/Resource.php(228): Google_Client->execute(Objec in /Test/libs/google-api-php-client-master/src/Google/IO/Curl.php on line 115
Also, here is my code:
$client = new Google_Client();
$client->setDeveloperKey("*****************");
$service = new Google_Service_YouTube($client);
$results = $service->playlists->listPlaylists("snippet", array("channelId" => "UCkyQHj9ceKEVZR2qO0LUUdg", "maxResults" => 50));
$results = $service->playlistItems->listPlaylistItems("snippet", array("playlistId" => "PL2Kceei6lZdpFRvkRyQMStS0UknLE3mKV", "maxResults" => 50));
The error is not consistent. It does not happen all of the time. When it does, which is often, I have to refresh my browser a couple of times, and then it works.
Has anyone encountered this?
I've been debugging this issue for days, but I can't think of anything else to try to fix this.
The error:
Fatal error: Uncaught exception 'Google_AuthException' with message 'Error refreshing the OAuth2 token, message: '{
"error" : "invalid_grant"
}'' in /html/cms/php/google-api-php-client/src/auth/Google_OAuth2.php:279
Stack trace:
#0 /html/cms/php/google-api-php-client/src/auth/Google_OAuth2.php(256): Google_OAuth2->refreshTokenRequest(Array)
#1 /html/cms/php/google-api-php-client/src/auth/Google_OAuth2.php(209): Google_OAuth2->refreshTokenWithAssertion()
#2 /html/cms/php/google-api-php-client/src/service/Google_ServiceResource.php(166): Google_OAuth2->sign(Object(Google_HttpRequest))
#3 /html/cms/php/google-api-php-client/src/contrib/Google_CalendarService.php(154): Google_ServiceResource->__call('list', Array)
#4 /html/cms/php/google_calendar_sync.php(41): Google_CalendarListServiceResource->listCalendarList()
#5 {main}
thrown in /html/cms/php/google-api-php-client/src/auth/Google_OAuth2.php on line 279
My server's clock is in sync:
2 Jan 13:35:36 ntpdate[1214]: adjust time server 62.212.76.57 offset 0.003544 sec
(62.212.76.57 being my colo company's time server)
I've triple checked my service account developer credentials at the Google APIs Console (I had a screenshot, but I can't use it because my account is too new :/). I've also successfully subscribed to the calendar service (also can't use the screenshot I made of this).
My code:
<?php
require_once(dirname(__FILE__) . '/google-api-php-client/src/Google_Client.php');
require_once(dirname(__FILE__) . '/google-api-php-client/src/contrib/Google_CalendarService.php');
session_start();
define('CLIENT_ID', 'XXXXXX510496.apps.googleusercontent.com');
define('SERVICE_ACCOUNT_NAME', 'XXXXXX510496#developer.gserviceaccount.com');
define('CALENDAR_ID', 'XXXXXXXXXXXXXXXXX');
define('KEY_FILE', dirname(__FILE__) . '/private/XXXXXXXXXXXXXXXXXXXX881a845ed4e4d2d58eb1-privatekey.p12');
$client = new Google_Client();
if (isset($_SESSION['token'])) {
$client->setAccessToken($_SESSION['token']);
}
$key = file_get_contents(KEY_FILE);
$client->setClientId(CLIENT_ID);
$client->setAssertionCredentials(new Google_AssertionCredentials(
SERVICE_ACCOUNT_NAME,
'https://www.google.com/calendar/feeds/' . CALENDAR_ID . '/private/full/',
$key)
);
$service = new Google_CalendarService($client);
$calendarList = $service->calendarList->listCalendarList();
echo "<h1>Calendar List</h1><pre>" . print_r($calendarList, true) . "</pre>";
?>
I've completely run out of ideas, so any help would be hugely appreciated!
I just posted a document that might help you get unstuck:
http://www.tqis.com/eloquency/googlecalendar.htm