carlcaulkett
carlcaulkett
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
No pressure 😉 Good luck 🤞
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I guess not...
🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
Unhandled exception caught during execution: Server.serve_connection: Failed to parse request
ERROR - HTTPRequest.from_bytes: Failed to parse request headers: No more bytes to read.
/ca_web/.magic/envs/default/bin/mojo: error: execution exited with a non-zero result: 1
[opc@ca-web-arm ~]$
🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
Unhandled exception caught during execution: Server.serve_connection: Failed to parse request
ERROR - HTTPRequest.from_bytes: Failed to parse request headers: No more bytes to read.
/ca_web/.magic/envs/default/bin/mojo: error: execution exited with a non-zero result: 1
[opc@ca-web-arm ~]$
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Hi @a2svior! I see that Lightbug is up to v0.1.12 as of 2 days ago. Does this mean that you've sorted out the crashing problem?
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
@a2svior Just woken up, and after leaving it in a working state last night, I tried it again, and found that it was failing, this time with a slightly different message...
🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
Unhandled exception caught during execution: Server.serve_connection: Failed to read request
ERROR - ReceiveError: An error occurred while attempting to receive data from the socket. Error code: 104
ERROR - Socket.receive: Failed to read data from connection.
ERROR - TCPConnection.read: Failed to read data from connection.
/ca_web/.magic/envs/default/bin/mojo: error: execution exited with a non-zero result: 1
🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
Unhandled exception caught during execution: Server.serve_connection: Failed to read request
ERROR - ReceiveError: An error occurred while attempting to receive data from the socket. Error code: 104
ERROR - Socket.receive: Failed to read data from connection.
ERROR - TCPConnection.read: Failed to read data from connection.
/ca_web/.magic/envs/default/bin/mojo: error: execution exited with a non-zero result: 1
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Amazingly, it has been up and working for an hour or more, but I just cannot work out what action will cause it to fail... 🤔
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
@a2svior Interesting that sometimes it seems to work okay...
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6bf9730aa18a ghcr.io/carlca/magic-image:latest "magic run default" About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 2 days ago Exited (0) 2 days ago objective_yonath
[opc@ca-web-arm ~]$ docker logs 6bf9730aa18a


🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
[opc@ca-web-arm ~]$ docker logs 6bf9730aa18a


🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
[opc@ca-web-arm ~]$
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6bf9730aa18a ghcr.io/carlca/magic-image:latest "magic run default" About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 2 days ago Exited (0) 2 days ago objective_yonath
[opc@ca-web-arm ~]$ docker logs 6bf9730aa18a


🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
[opc@ca-web-arm ~]$ docker logs 6bf9730aa18a


🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
[opc@ca-web-arm ~]$
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
np. Good catch 🫴⚾️
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
It seems strange they way the page is sometimes served but not others. Maybe it's some kind of cumulative problem whereby something has to reach a critical level before an exception is thrown... 🤔
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I see it is the same 😃
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Is this what you had?
🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
Unhandled exception caught during execution: Server.serve_connection: Failed to parse request
ERROR - HTTPRequest.from_bytes: Failed to parse request headers: No more bytes to read.
/ca_web/.magic/envs/default/bin/mojo: error: execution exited with a non-zero result: 1
🔥🐝 Lightbug is listening on http://0.0.0.0:8080
Ready to accept connections...
Unhandled exception caught during execution: Server.serve_connection: Failed to parse request
ERROR - HTTPRequest.from_bytes: Failed to parse request headers: No more bytes to read.
/ca_web/.magic/envs/default/bin/mojo: error: execution exited with a non-zero result: 1
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
I'm using Oracle Cloud now but yeah, even when I couldn't access my page by the web, docker ps -a was showing...
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e8c821b727d2 ghcr.io/carlca/magic-image:latest "magic run default" 8 seconds ago Up 7 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 42 hours ago Exited (0) 42 hours ago objective_yonath
[opc@ca-web-arm ~]$
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e8c821b727d2 ghcr.io/carlca/magic-image:latest "magic run default" 8 seconds ago Up 7 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 42 hours ago Exited (0) 42 hours ago objective_yonath
[opc@ca-web-arm ~]$
I didn't know about docker logs container-id though... I'lll try that now 😉
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Where do I find them?
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
No! That's the confusing thing... the container doesn't seem to be going down, just access to it from outside of Oracle, ie. through http://132.145.47.167:8080, seems to be intermittent...
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
and here is the HTML from my app..
[opc@ca-web-arm ~]$ curl http://localhost:8080
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Audiowide|Sofia|Trirong|Aclonica|Bilbo|Salsa">
<link rel="stylesheet" type="text/css" href="style.css">
<title>lightspeed_http and ca_web test</title>
</head>
<body>
<p id='datetime'></p>
<script>
let updateTime = function() {
var datetime = new Date();
document.getElementById('datetime').innerHTML = datetime
}
setInterval(updateTime, 1000);
</script>
<h1>Audiowide</h1>
<h2>Sofia</h2>
<h3>Trirong</h3>
<h4>Aclonica</h4>
<h5>Bilbo</h5>
<h6>Salsa</h6>
<form name=form action=/ method=post>
<input type=text name="username" value="carl" class="fancy_input" size="23" maxlength="23" >
<input type=password name="password" value="1234go" class="fancy_input" size="23" maxlength="23" >
<input type=submit value=Submit>
</form>
<p id='username_post'>Username (POST): </p>
<p id='password_post'>Password (POST): </p>
<p id='username'>Username (DOM): </p>
<p id='password'>Password (DOM): </p>
<button type="button" onclick="updateDom()" >Update Outputs</button>
<script>
let updateDom = function() {
document.getElementById('username').innerHTML += '';
document.getElementById('password').innerHTML += '';
}
</script>
</body>
</html>
[opc@ca-web-arm ~]$ curl http://localhost:8080
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Audiowide|Sofia|Trirong|Aclonica|Bilbo|Salsa">
<link rel="stylesheet" type="text/css" href="style.css">
<title>lightspeed_http and ca_web test</title>
</head>
<body>
<p id='datetime'></p>
<script>
let updateTime = function() {
var datetime = new Date();
document.getElementById('datetime').innerHTML = datetime
}
setInterval(updateTime, 1000);
</script>
<h1>Audiowide</h1>
<h2>Sofia</h2>
<h3>Trirong</h3>
<h4>Aclonica</h4>
<h5>Bilbo</h5>
<h6>Salsa</h6>
<form name=form action=/ method=post>
<input type=text name="username" value="carl" class="fancy_input" size="23" maxlength="23" >
<input type=password name="password" value="1234go" class="fancy_input" size="23" maxlength="23" >
<input type=submit value=Submit>
</form>
<p id='username_post'>Username (POST): </p>
<p id='password_post'>Password (POST): </p>
<p id='username'>Username (DOM): </p>
<p id='password'>Password (DOM): </p>
<button type="button" onclick="updateDom()" >Update Outputs</button>
<script>
let updateDom = function() {
document.getElementById('username').innerHTML += '';
document.getElementById('password').innerHTML += '';
}
</script>
</body>
</html>
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Here is my Oracle Cloud CLI...
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e8c821b727d2 ghcr.io/carlca/magic-image:latest "magic run default" 8 seconds ago Up 7 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 42 hours ago Exited (0) 42 hours ago objective_yonath
[opc@ca-web-arm ~]$
[opc@ca-web-arm ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e8c821b727d2 ghcr.io/carlca/magic-image:latest "magic run default" 8 seconds ago Up 7 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp ca-web-container
f2944de77a11 hello-world "/hello" 42 hours ago Exited (0) 42 hours ago objective_yonath
[opc@ca-web-arm ~]$
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Now it's not working, I've got visions of some vindictive person radomly flicking a switch on and off to block or allow me access 😮
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Now it's working again. Go figure 🙃
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
It's interesting that for a lot of the time that I couldn't access the web page via the address I've just mentioned, I could still ssh into the Oracle Cloud CLI and issue curl http://localhost:8080 and get the full HTML, proving that my app and lightbug were both working as expected. It was just that access to the public web address was being blocked by something, and my first thoughts were that it was firewall related.
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
That's what http://132.145.47.167:8080/ is, isn't it. To give you an example of the hassle I'm having, that address worked 5 minutes ago, but is not working now!
365 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
@Owen Hilyard I've got a problem with Oracle Cloud and I wonder if you might know the answer. My instance is running and Docker is running and hosting my Mojo app just fine. If I ssh inyo the Oracle Cloud and issue a curl http://localhost:8080 the correct HTML comes back proving that the Mojo app is running. Where I'm having problems is accessing the page via http://132.145.47.167:8080/. It seems to be okay right at the second, but every time I do an update and push a revised Docker, it seems to take ages before I can gain access to it again. I wondered if it was down to the firewall provisions. I've added an Ingress rule to allow access on port 8080, and, for a while I was workiing on the assumption that I had to delete the existing Ingress rule and reenter it exactly as before, in order to give the firewall a nudge, as it were, But i've abandoned this theory. Instead, it just seems to take ages before I can access the site again. It's really frustrating 😮
365 replies