-
Notifications
You must be signed in to change notification settings - Fork 508
Has anyone managed to get an account in the recent months? #93
Comments
Consider switching to a pay-as-you-go plan to enjoy priority access over free tier users while retaining all the benefits of always free resources. Keep in mind that you'll need approximately EUR 120 balance on your credit card for a temporary hold. |
@hitrov, I don't need paid hosting (if I'll need one, I do have an options 10 times cheaper than Oracle). I just curious if anyone got luck last months (as I got this spring). P.S. I'm trying to get new one for my brother in law, not a second one for me - he was really excited when I showed him "how the stuff works" 😉 He's currently used real PC running at home; he has some issues after blackout so "always free tier" Oracle hosting is a pretty good option. P.P.S. Or might be I don't get you correctly? AFAIK, "pay-as-you-go" aren't free at all and Oracle's hosting is pretty expensive (comparing with current market options)? CC balance isn't issue |
You missed the point, always free resources are still available at no cost, the benefit is additional capacity, see for yourself https://www.google.com/search?q=reddit+oracle+cloud+pay+as+you+go |
OK, thanks, it looks like I really missed the point! (my bad) Will read more about this opportunity; but could you confirm (if you already tried) there is no catch? |
No catch, make sure you have external backups and alerting upon reaching let’s say >$1 level of expenses in case if you’ll launch anything occasionally |
BTW, Alex, would you mind to create a short "how to" guide (in the readme.md - 'cause current looks an obsolete now) for creating and using "pay-as-you-go" free account? For the "stupidos" like me 😜 as current readme.md written for 😉 |
Hi I just got one last night, in ashburn AD-3, maybe I got lucky, I setup a screen to run the php script every like 3-5 minutes, I just setup an ip and its working well :) nice script |
I've been running mine since then, I am into Run #7447 now. Still not getting one (SG) also "Too many request" has been more lately for me. Even though I raised the timeout. |
@lars0x3a I'm facing the same issue as well, too many timeouts..did you find any solution? |
Nope. Still facing the same issue. |
It still works. I set mine to run every 2 minutes. Had several "timeout errors", but got an instance this morning. Only ran for 8-9 days so I feel very lucky. I was prepared for weeks of waiting. |
Update: I think Oracle Disabled my account, I am getting a shape not found (worker) and even on the web based console. :( |
I've had mine running since at least 05/26/23 in US-SANJOSE-1-AD-1 and no luck. |
@lars0x3a have you got it now? |
So, regardless of Alex @hitrov pretty smart advice (about creating a "pay as you go" account - btw, already tested and it works seamlessly, I can confirm), this "completely free" procedure is still working: just keep your script running! I've got (in addition to "pay as you go") a complete free account (proofed by $5 virtual gift card, non existed anymore) after about two and a half months script running on US us_ashburn-1 (I've used Ubuntu subsystem for Windows, by the instance). BTW, I'm really enjoying free but really powerful Oracle's virtual machines: you can host even an ASP .NET solutions for free, like https://dimebuttons.com/proxy/ (this one was published as a "proof of concept", I just won a sixpack of the good beer, nothing more 😉 ) |
Nope. I stopped mine. Because they seem to disable my OCI Access. :( |
@lars0x3a did you have any always free AMD instances before hand that still operate? |
Nope. |
I just got a free one in eu-frankfurt-1 yesterday! Took approximately 2 days of running this script: <?php
declare(strict_types=1);
$lock = fopen(__FILE__, 'rb');
if (!flock($lock, LOCK_EX | LOCK_NB)) {
die("Already running.\n");
}
/**
* better version of shell_exec(),
* supporting both stdin and stdout and stderr and os-level return code
*
* @param string $cmd
* command to execute
* @param string $stdin
* (optional) data to send to stdin, binary data is supported.
* @param string $stdout
* (optional) stdout data generated by cmd
* @param string $stderr
* (optional) stderr data generated by cmd
* @param bool $print_std
* (optional, default false) if you want stdout+stderr to be printed while it's running,
* set this to true. (useful for long-running commands)
* @return int
*/
function hhb_exec(string $cmd, string $stdin = "", string &$stdout = null, string &$stderr = null, bool $print_std = false): int
{
$stdouth = tmpfile();
$stderrh = tmpfile();
$descriptorspec = array(
0 => array(
"pipe",
"rb"
), // stdin
1 => array(
"file",
stream_get_meta_data($stdouth)['uri'],
'ab'
),
2 => array(
"file",
stream_get_meta_data($stderrh)['uri'],
'ab'
)
);
$pipes = array();
$proc = proc_open($cmd, $descriptorspec, $pipes);
while (strlen($stdin) > 0) {
$written_now = fwrite($pipes[0], $stdin);
if ($written_now < 1 || $written_now === strlen($stdin)) {
// ... can add more error checking here
break;
}
$stdin = substr($stdin, $written_now);
}
fclose($pipes[0]);
unset($stdin, $pipes[0]);
if (!$print_std) {
$proc_ret = proc_close($proc); // this line will stall until the process has exited.
$stdout = stream_get_contents($stdouth);
$stderr = stream_get_contents($stderrh);
} else {
$stdout = "";
$stderr = "";
stream_set_blocking($stdouth, false);
stream_set_blocking($stderrh, false);
$fetchstd = function () use (&$stdout, &$stderr, &$stdouth, &$stderrh): bool {
$ret = false;
$tmp = stream_get_contents($stdouth); // fread($stdouth, 1); //
if (is_string($tmp) && strlen($tmp) > 0) {
$ret = true;
$stdout .= $tmp;
fwrite(STDOUT, $tmp);
}
$tmp = stream_get_contents($stderrh); // fread($stderrh, 1); //
// var_dump($tmp);
if (is_string($tmp) && strlen($tmp) > 0) {
$ret = true;
$stderr .= $tmp;
fwrite(STDERR, $tmp);
}
return $ret;
};
while (($status = proc_get_status($proc))["running"]) {
if (!$fetchstd()) {
// 100 ms
usleep(100 * 1000);
}
}
$proc_ret = $status["exitcode"];
proc_close($proc);
$fetchstd();
}
fclose($stdouth);
fclose($stderrh);
return $proc_ret;
}
$cmd = "php index.php 2>&1";
for (;;) {
echo ".";
$ret = hhb_exec($cmd, "", $stdout, $stderr, true);
$expected = array(
'ret' => 0,
'stdout' => '{
"code": "InternalError",
"message": "Out of host capacity."
}
{
"code": "InternalError",
"message": "Out of host capacity."
}
{
"code": "InternalError",
"message": "Out of host capacity."
}
',
'stderr' => '',
);
$expected['stdout'] = trim($expected['stdout']);
$actual = array(
'ret' => $ret,
'stdout' => $stdout,
'stderr' => $stderr,
);
$actual['stdout'] = trim($actual['stdout']);
if (
str_starts_with($actual['stdout'], 'PHP Fatal error: Uncaught Hitrov\\Exception\\TooManyRequestsWaiterException: Will retry after')
|| str_contains($actual['stdout'], '"TooManyRequests"')
) {
// Will retry after 83 seconds
preg_match('/Will retry after (\d+) seconds/', $actual['stdout'], $matches);
//var_dump($matches);
$seconds = (int) ($matches[1] ?? 100);
$seconds = 1000;
for ($i = 1; $i < ($seconds + 1); ++$i) {
echo "{$i}/{$seconds}\r";
sleep(1);
}
echo "\n";
continue;
}
if (
preg_replace('/\s+/', '', $expected['stdout']) !== preg_replace('/\s+/', '', $actual['stdout'])
) {
echo "Unexpected STDOUT output, dumping...\n";
$actual = var_export($actual, true);
$expected = var_export($expected, true);
file_put_contents(__FILE__ . ".actual", $actual);
file_put_contents(__FILE__ . ".expected", $expected);
echo "Actual output:\n$actual\n";
die();
}
if ($expected['stderr'] !== $actual['stderr']) {
echo "Unexpected STDERR output, dumping...\n";
$actual = var_export($actual, true);
$expected = var_export($expected, true);
file_put_contents(__FILE__ . ".actual", $actual);
file_put_contents(__FILE__ . ".expected", $expected);
echo "Actual output:\n$actual\n";
die();
}
if ($expected['ret'] !== $actual['ret']) {
echo "Unexpected return code, dumping...\n";
$actual = var_export($actual, true);
$expected = var_export($expected, true);
file_put_contents(__FILE__ . ".actual", $actual);
file_put_contents(__FILE__ . ".expected", $expected);
echo "Actual output:\n$actual\n";
die();
}
for($i=1,$imax=701;$i<$imax; ++$i){
echo "{$i}/{$imax}\r";
sleep(1);
}
continue;
echo "Unexpected output, dumping...\n";
$actual = var_export($actual, true);
$expected = var_export($expected, true);
file_put_contents(__FILE__ . ".actual", $actual);
file_put_contents(__FILE__ . ".expected", $expected);
echo "Actual output:\n$actual\n";
die();
} edit: added the flock double-run protection discussed below. |
@divinity76 How to use that script? |
@peprmint1 you need php-cli installed and put the script in the
|
You got "too many requests" error, so it waits 1000 seconds before trying again. There are reports of people getting banned for spamming the API too much, so better being a few minutes late than being /banned/. |
@divinity76 whats the source of the script you provided? or is it written by you yourself |
@Mafia-Atharva wrote it myself. Didn't really like the the cronjob approach suggested in the README. What happens if you get the server, and don't notice, and your cronjobs keeps running? i think the cronjob will just spam the api forever until stopped, my approach stops immidiately when it gets an output it does not understand (like actually getting the server, it intentionally does not understand that, and crash) |
Okay, gonna gamble and go with your script assuming it's safe (hope I don't get banned, look at this poor reddit user) |
@Mafia-Atharva my script should be safer than the cronjob at least. Still, it's probably a good idea to add <?php
declare(strict_types=1);
$lock = fopen(__FILE__, 'rb');
if (!flock($lock, LOCK_EX | LOCK_NB)) {
die("Already running.\n");
} just to make absolutely sure it cannot run 2 instances at once |
@divinity76 have i pasted the last portion of your code at the correct place? <?php
declare(strict_types=1);
/**
* better version of shell_exec(),
* supporting both stdin and stdout and stderr and os-level return code
*
* @param string $cmd
* command to execute
* @param string $stdin
* (optional) data to send to stdin, binary data is supported.
* @param string $stdout
* (optional) stdout data generated by cmd
* @param string $stderr
* (optional) stderr data generated by cmd
* @param bool $print_std
* (optional, default false) if you want stdout+stderr to be printed while it's running,
* set this to true. (useful for long-running commands)
* @return int
*/
$lock = fopen(__FILE__, 'rb');
if (!flock($lock, LOCK_EX | LOCK_NB)) {
die("Already running.\n");
}
function hhb_exec(string $cmd, string $stdin = "", string &$stdout = null, string &$stderr = null, bool $print_std = false): int
{
$stdouth = tmpfile();
$stderrh = tmpfile();
$descriptorspec = array(
0 => array(
"pipe",
"rb"
), // stdin
1 => array(
"file",
stream_get_meta_data($stdouth)['uri'],
'ab'
),
2 => array(
"file",
stream_get_meta_data($stderrh)['uri'],
'ab'
)
);
$pipes = array();
$proc = proc_open($cmd, $descriptorspec, $pipes);
while (strlen($stdin) > 0) {
$written_now = fwrite($pipes[0], $stdin);
if ($written_now < 1 || $written_now === strlen($stdin)) {
// ... can add more error checking here
break;
}
$stdin = substr($stdin, $written_now);
}
fclose($pipes[0]);
unset($stdin, $pipes[0]);
if (!$print_std) {
$proc_ret = proc_close($proc); // this line will stall until the process has exited.
$stdout = stream_get_contents($stdouth);
$stderr = stream_get_contents($stderrh);
} else {
$stdout = "";
$stderr = "";
stream_set_blocking($stdouth, false);
stream_set_blocking($stderrh, false);
$fetchstd = function () use (&$stdout, &$stderr, &$stdouth, &$stderrh): bool {
$ret = false;
$tmp = stream_get_contents($stdouth); // fread($stdouth, 1); //
if (is_string($tmp) && strlen($tmp) > 0) {
$ret = true;
$stdout .= $tmp;
fwrite(STDOUT, $tmp);
}
$tmp = stream_get_contents($stderrh); // fread($stderrh, 1); //
// var_dump($tmp);
if (is_string($tmp) && strlen($tmp) > 0) {
$ret = true;
$stderr .= $tmp;
fwrite(STDERR, $tmp);
}
return $ret;
};
while (($status = proc_get_status($proc))["running"]) {
if (!$fetchstd()) {
// 100 ms
usleep(100 * 1000);
}
}
$proc_ret = $status["exitcode"];
proc_close($proc);
$fetchstd();
}
fclose($stdouth);
fclose($stderrh);
return $proc_ret;
}
$cmd = "php index.php 2>&1";
for (;;) {
echo ".";
$ret = hhb_exec($cmd, "", $stdout, $stderr, true);
$expected = array(
'ret' => 0,
'stdout' => '{
"code": "InternalError",
"message": "Out of host capacity."
}
{
"code": "InternalError",
"message": "Out of host capacity."
}
{
"code": "InternalError",
"message": "Out of host capacity."
}
',
'stderr' => '',
);
$expected['stdout'] = trim($expected['stdout']);
$actual = array(
'ret' => $ret,
'stdout' => $stdout,
'stderr' => $stderr,
);
$actual['stdout'] = trim($actual['stdout']);
if (
str_starts_with($actual['stdout'], 'PHP Fatal error: Uncaught Hitrov\\Exception\\TooManyRequestsWaiterException: Will retry after')
|| str_contains($actual['stdout'], '"TooManyRequests"')
) {
// Will retry after 83 seconds
preg_match('/Will retry after (\d+) seconds/', $actual['stdout'], $matches);
//var_dump($matches);
$seconds = (int) ($matches[1] ?? 100);
$seconds = 1000;
for ($i = 1; $i < ($seconds + 1); ++$i) {
echo "{$i}/{$seconds}\r";
sleep(1);
}
echo "\n";
continue;
}
if (
preg_replace('/\s+/', '', $expected['stdout']) !== preg_replace('/\s+/', '', $actual['stdout'])
) {
echo "Unexpected STDOUT output, dumping...\n";
$actual = var_export($actual, true);
$expected = var_export($expected, true);
file_put_contents(__FILE__ . ".actual", $actual);
file_put_contents(__FILE__ . ".expected", $expected);
echo "Actual output:\n$actual\n";
die();
}
if ($expected['stderr'] !== $actual['stderr']) {
echo "Unexpected STDERR output, dumping...\n";
$actual = var_export($actual, true);
$expected = var_export($expected, true);
file_put_contents(__FILE__ . ".actual", $actual);
file_put_contents(__FILE__ . ".expected", $expected);
echo "Actual output:\n$actual\n";
die();
}
if ($expected['ret'] !== $actual['ret']) {
echo "Unexpected return code, dumping...\n";
$actual = var_export($actual, true);
$expected = var_export($expected, true);
file_put_contents(__FILE__ . ".actual", $actual);
file_put_contents(__FILE__ . ".expected", $expected);
echo "Actual output:\n$actual\n";
die();
}
for($i=1,$imax=701;$i<$imax; ++$i){
echo "{$i}/{$imax}\r";
sleep(1);
}
continue;
echo "Unexpected output, dumping...\n";
$actual = var_export($actual, true);
$expected = var_export($expected, true);
file_put_contents(__FILE__ . ".actual", $actual);
file_put_contents(__FILE__ . ".expected", $expected);
echo "Actual output:\n$actual\n";
die();
} also here
php-cli means the normal cli interface you get on your ssh connection right? or its some another tool that you have to download like php? |
not really. it will work! but looks funny to have it under the documentation for
yup. |
alright thanks will start the script now, may the oracle lord of resources bless me |
What steps do you guys think I need to make? Is it even possible to reactivate my API Access? |
I think you need to get a new email and credit card, and make a new account at Oracle. |
Creating a new account, I'll try. 2 cronjobs no, I even adjusted the cronjob to run 2x every hour. 🥲 |
@divinity76 your script is exiting after running once, how do i make it go into a loop? |
@Mafia-Atharva that's interesting, the script was written with the assumption that the region has 3x "Availability domains" (because on my region, it has 3), and thus expect 3x "Out of host capacity" errors, 1x error for each availability domain. However, it seems whatever region your account is in has only 1 availability domain, and thus you only get 1x "Out of host capacity" error.. to account for that, change it to $expected = array(
'ret' => 0,
'stdout' => '{
"code": "InternalError",
"message": "Out of host capacity."
}',
'stderr' => '',
);
|
@divinity76 Trying to run the script but it gives me a syntax error: |
@Mafia-Atharva Did you get an instance yet? |
@yolanv line 10 is a comment.. probably something bad happened in your copy-paste. Still, what do you get by running |
It was indeed some copypasting shenanigans, nano tends to be unlucky with these kind of situations. EDIT: the script crashes when there are too many requests sent to OC. Any fix for that? |
@apotoxinsherry nope, what about you? Which region are you in |
@yolanv now i suspect you ran index.php instead of my |
Sorry for the late reply. The problem was that I did not have PHP 8.2 installed, which apparently comes with the str_starts_with function. upgraded, everything works as expected now :) thanks! |
Just want to report some data points. The script is working, but I think Oracle is considering free tier very very low priority. I tried this script with two of my accounts, but I didn't get any Flex instance for two days. Then I tried to upgrade my account to pay-to-go. The moment I got email confirmation that my account is upgraded (a few hours after I filled my credit card information on Oracle Cloud), I got a Flex instance instantly! So if you are not getting any luck after running this scripts for a few days, try upgrading your account. I used a virtual credit card number generated from my bank online website, then after upgrade is successful, I just voided that virtual credit card to make sure no actual charge will happen. |
Thanks for sharing! I wouldn’t recommend to have invalid card attached as Oracle verifies it time after time, and only god knows what’s gonna happen if test charge won’t succeed |
@ql-owo-lp can you verify if you are able to delete your flex instance and re provision another one? I had to reset my instance and had to terminate it, as a result since then I have been receiving EDIT: I must add that, once I attempted to reprovision via the cloud console interface I can get a new arm64 instance running, but the script continues to run and logs the same "out of host capacity" error. |
I terminated the existing flex one then created a new one. |
And here I am, lost my mobile so no 2FA for me. :( |
Hmm seeing that someone said they ran the script for 6 months in san jose without success (My Region) ima upgrade my account and see what happens |
OMG, It worked First Try! |
Has anyone managed to get an account in the recent months?
Currently I'm running a script on us_ashburn-1 (also 2 & 3) about month and a half without any luck 😢
This March I got an account after a few days of running (but after big Oracle's blackout).
The text was updated successfully, but these errors were encountered: