#[SOLVED] Could not resolve host

64 messages · Page 1 of 1 (latest)

woven hull
#

Hello everyone, I'm having a issue executing my ruby function, it's a simple hello world

puts "Hello world!"

But I'm facing this error message:

An internal curl error has occurred within the executor! Error Msg: Could not resolve host: traspaso-63e655c39fe6727b25e4

My docker compose, executor logs and my docker ps are attached

proud depot
#

@iron sierra

#

Seems like the container didn't start properly

nova osprey
#

could you try shutting all the containers and starting it again
docker compose down
then docker compose up ??

#

If the issue still persists
wrap you code in try catch block and when it hits the catch block you could
use res.send() to send a json which could be stack trace of the code. That may help you better to debug more

blissful lantern
woven hull
woven hull
nova osprey
woven hull
nova osprey
# woven hull I'm just starting to learn ruby 😅 it does run from my cli though:

so I read the docs and you need to define a main method. I assume it's similar like python so it works on CLI.

Try doing something like this below if you want. Just make sure to create a main method and do stuff in it.
https://appwrite.io/docs/functions

def main(req, res)
  payload =
    !req.payload.empty? ? req.payload :
    'No payload provided. Add custom data when executing function.'

  secretKey =
    req.variables['SECRET_KEY'] ||
    'SECRET_KEY variable not found. You can set it in Function settings.'

  randomNumber = rand()

  trigger = req.variables['APPWRITE_FUNCTION_TRIGGER']

  return res.json({
    :message => 'Hello from Appwrite!',
    :payload => payload,
    :secretKey => secretKey,
    :randomNumber => randomNumber,
    :trigger => trigger,
  })
end
woven hull
nova osprey
#

did you redeployed your function again??

#

and how are deploying it??

woven hull
#

I'm creating it manually through console and ticking the "Activate Deployment after build" option

nova osprey
#

uploading manually is a little pain

#

and sometimes it does not work even if you do everything right

#

CLI would ensure that it be deployed successfully

woven hull
#

I'll give it a shot

woven hull
nova osprey
#

cc @blissful lantern I am out ideas now

blissful lantern
# woven hull Same result :/

Would you please try running appwrite init function to initialize the starter code and then appwrite deploy function?

#

Also, how did you install Appwrite?

woven hull
blissful lantern
# woven hull Hmm

i think you need to make sure you have the latest version of git installed

woven hull
#

Installed with docker compose up -d with the file I attached earlier

blissful lantern
woven hull
woven hull
#

What I'm not sure is if I should source .env before running docker compose up -d

blissful lantern
blissful lantern
woven hull
#

Something I do have different is that IPv6 is enabled on docker in my machine, maybe it could be interfering (since the problem seems to be networking)

woven hull
blissful lantern
blissful lantern
# woven hull Hmm

this is a separate problem, though...maybe you don't have permissions on that functions folder?

woven hull
#

Appwrite is up and running again, will try to make everything through the appwrite cli

proud depot
#

It does look like it doesn't have access to that folder

#

👀

blissful lantern
#

And what version of node do you have?

woven hull
#

Nothing currently

blissful lantern
#

And what version of node do you have?

woven hull
#

Yep, definitely something wrong with git, let me troubleshoot that and will be back

blissful lantern
#

Maybe it's not node...maybe it's git

woven hull
#

Smh Ubuntu 🤦🏻‍♂️

blissful lantern
woven hull
#

Created the function succesfully:

But I ran appwrite deploy function and it seems that nothing happened

blissful lantern
woven hull
#

Lmao my bad

woven hull
blissful lantern
# woven hull So what's the tweak needed in the `.env` file, just to sum things up

the runtimes network env var. by default, it's appwrite_runtimes, but since your files were in a folder named appwrite-be, the network was appwrite-be_runtimes. So this was the problem that resulted in the following error:

An internal curl error has occurred within the executor! Error Msg: Could not resolve host: traspaso-63e655c39fe6727b25e4

The other problem you had was the format of the code. that would have probably resulted in a connection timed out error

woven hull
#

I see, thank you, and thanks everyone else for your time 🙌