Need help in create process

I am just starting learning here, but I get some errors when creating a process. I used this tutorial:

when I do the first step, I just copy-paste it, compile done but when I want to createmes
this is the error : Error: Unexpected token m in JSON at position 0

and even when I try to copy-paste this example :
I get this error :
› Error: env variable PROVIDER_ENDPOINT must be set

I hope someone helps me to find solution to create a safe process.

Hello @L-KH, it seems that your process file is not valid. First, I see that you have myfirstprocess.ts. The file should be a JSON.

With the processes, you need to compile and then create them. The process file is a yaml, and the result of the compilation is a JSON.

You can use the following command to compile and create at the same time

mesg-cli process:create "$(mesg-cli process:compile YOUR_PROCESS_FILE.YML)"

Also, if you are developing with it, I highly recommend using the dev command that will compile, deploy, display the logs, and clean up when you exit your process.

mesg-cli process:dev YOUR_PROCESS_FILE.YML

Could you check that your process file is a valid yaml. The documentation display some ... that shouldn’t be part of the file.

The error env variable PROVIDER_ENDPOINT must be set is normal, this is because your process requires an env variable so you can fix this by appending the flag --env PROVIDER_ENDPOINT=your_provider_endpoint and this will solve your issue.

We just released a tutorial about the processes. I recommend you to have a look at it

I hope I was able to help :wink:
Let me know if you have more issues

1 Like

Thank you so much, that was really very helpfull. about .ts extention I just find it here
so i thought that process is a .ts extention.
I tried to compile and its done now. but again in create I get error " Error: 14 UNAVAILABLE: DNS resolution failed "
I didn’t try the email sender because I don"t have SendGreed API . but I just want to try to compile and create my first process.
Thank you

Your error Error: 14 UNAVAILABLE: DNS resolution failed might come from 2 problems:

  • Your MESG engine is not running and you can run it with mesg-cli daemon:start
  • One of the service you try to use is unreachable, maybe a typo in an url in your instance/src value.

I could help you more if you share your process file.

thank you for your support.
Its really weird because mesg-cli is already started !! i didn’t understand well about instance/src solution . but my process file was just copy paste of the examples here
as I said file is just copy paste because i just want to know how it work and how create my first process.

  • i use here google cloud machine !! is this could supose problem with docker-ce ?

The whole orchestrator system and the processes are based on MESG services. The instanceHash in the example is the instance of a service that is running, but you need to have this service running, and then you can use the instanceHash of the service and replace it in your process file.
Or, you can use the instance resolution and have your service automatically deployed, started, and injected in your process file.

Have a look at our tutorial about the processes, this is a real example, the documentation examples are examples of specific usage of each feature of the processes.

Thank you so much for your time. but still the same problem apear even i take the code from your tutorial.
I just think problem is from google cloud with docker !! I will try later to install it in my own vm linux machine.
thank you