MESOSFER APP CRASH!

Home - MESOSFER APP CRASH!

Jordan Maulana asked 2 years ago

i am working on display real-time data to my web..

so i am loading my bucket with this code every 1 second

<?php
require dirname(__DIR__).’/mesosfer/vendor/autoload.php’;
const ACCESS_TOKEN = “Z3Pko6F7RryXcTi3kP05og”;
const BUCKET_NAME = “Log”;
const APP_ID = “secret”;
const APP_KEY = “secret”;
$client = new \GuzzleHttp\Client();
try{
$respGetBucket = $client->request(‘GET’, ‘https://api.mesosfer.com/api/v2/data/bucket/&#8217;.BUCKET_NAME, [
‘headers’ => [‘Authorization’ => ‘Bearer ‘.ACCESS_TOKEN, ‘X-Mesosfer-AppId’ => APP_ID, ‘X-Mesosfer-AppKey’ => APP_KEY]
]);
$bodyBucket = (string) $respGetBucket->getBody();
$getBucket = json_decode($bodyBucket,true);
//print_r($getBucket);
//echo “<br>”;

foreach($getBucket[‘results’] as $row){
echo ($row[‘metadata’][‘do’]);
}
}
catch(Exception $e){
echo $e->getMessage();
}
?>

but then it shows error : too many request (or just like that, i do not remember)
and now i can not open my application base in mesosfer web..
i can not open User, Installation, BUCKET!!, and Device

my other app is fine..
please help..

3 Answers
Jordan Maulana answered 2 years ago

+ could you tell me how to show my code correctly in a question?
i currently have no idea how to do it so i just paste it as regular text..

Alann Maulana Staff replied 2 years ago

Hi jordan,

You can paste your code by clicking “< >” icon in the visual editor.

Jordan Maulana replied 2 years ago

hoooooo thanks a lot

Jordan Maulana answered 2 years ago

This is my error when the code below is running
Client error: `GET https://api.mesosfer.com/api/v2/data/bucket/Log` resulted in a `429 Too Many Requests` response: {“error”:{“code”:904,”error”:”API rate limit exceeded”}}

<?php
require dirname(__DIR__).'/mesosfer/vendor/autoload.php';
const ACCESS_TOKEN = "Z3Pko6F7RryXcTi3kP05og";
const BUCKET_NAME = "Log";
const APP_ID = "y92HBufIzN";
const APP_KEY = "T1801V0ype8Jf2cBXl5KKPnaTTbE95yd";
$client = new \GuzzleHttp\Client();
try{
$respGetBucket = $client->request('GET', 'https://api.mesosfer.com/api/v2/data/bucket/'.BUCKET_NAME, [
'headers' => ['Authorization' => 'Bearer '.ACCESS_TOKEN, 'X-Mesosfer-AppId' => APP_ID, 'X-Mesosfer-AppKey' => APP_KEY]
]);
$bodyBucket = (string) $respGetBucket->getBody();
$getBucket = json_decode($bodyBucket,true);
//print_r($getBucket);
//echo "<br>";

foreach($getBucket['results'] as $row){
echo ($row['metadata']['do']);
}
}
catch(Exception $e){
echo $e->getMessage();
}
?>

now my mesosfer APP’s BASE is under error.
i can do nothing with my base, users are lost, nothing can be shown.

Jordan Maulana replied 2 years ago

hmmmmmmmmmmm i forgot to remove appid and appkey
the comment cannot be edited nor deleted..
the app cannot be deleted too 🙁

Muhammad Irwantoro replied 2 years ago

Jordan, hati-hati

Badrullami Staff answered 2 years ago

Hi Jordan,
If you got error 429 –> Too Many Requests, it means that your api call has exceeded the limit. Wait until 24 hours, it will be reset automatically. 
Thanks.

Your Answer