Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running scheduled job #144

Open
Fats25 opened this issue Oct 8, 2020 · 12 comments
Open

Issue running scheduled job #144

Fats25 opened this issue Oct 8, 2020 · 12 comments

Comments

@Fats25
Copy link

Fats25 commented Oct 8, 2020

Apologies if a stupid question, this is first time I have tried automation, or used Automagica!

I downloaded the package directly (windows 10) yesterday.

I have successfully created a process in Automagica Flow, and tested and all working.
I created a new process in portal and imported the .josn file created in Flow.
I created a job to run the new process on a schedule.
I ensured that the Bot was running locally on same machine, and is showing as online in Portal - and is part of same team.

I tried to test the job by clicking on green arrow under the process, and it tries to run the job. When the job runs it I see Automagica receive the job, and immediately a connection error. If I look in the jobs, it remains running, but nothing is happening. I am guessing the connection error is either to the Bot, or to the Portal. I am unsure which it is or how to check further.

For the Bot configuration I have tried with the user secret blank, and also with the user secret as a copy of the Bot Secret (as shown here - https://automagica.readthedocs.io/bot.html). I get the same error.

What am I missing here?

Many Thanks

@Fats25
Copy link
Author

Fats25 commented Oct 10, 2020

I have found the log file, and can see where the error is:-

2020-10-10 05:59:07,686 [INFO]: Received job 12d0f2a5-605a-44eb-ad22-8dc4c938ddef
2020-10-10 05:59:08,324 [ERROR]: Could not reach Automagica Portal. Waiting 10 second(s) before retrying.
Traceback (most recent call last):
File "C:\Users\Chris\AppData\Local\Automagica\pkgs\automagica\gui\apps.py", line 300, in _runner_thread
entrypoint, local_job_path
File "C:\Users\Chris\AppData\Local\Automagica\pkgs\automagica\gui\apps.py", line 197, in run_command
process = subprocess.Popen([command], stdout=subprocess.PIPE, cwd=cwd,)
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 800, in init
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 1207, in _execute_child
OSError: [WinError 87] The parameter is incorrect

I removed Automagica from machine, and reinstalled, and have exactly the same error again.

Also tried on another Windows 10 machine, and again I have identical error.

@kathawala
Copy link

@Fats25 can you post the job information and details about the command you are trying to run? I suspect the command in the Popen call is malformed or missing.

@Fats25
Copy link
Author

Fats25 commented Oct 10, 2020

I am not sure I am technical enough to understand the question!

Would it be at the start of the .Josn file? I'm happy to post the .Josn file here if that is what you mean?

@kathawala
Copy link

@Fats25 sure post the json file here let's take a look. If you can tell more details about the job you are trying to run that might help too

@Fats25
Copy link
Author

Fats25 commented Oct 11, 2020

Its a very simple job to make an unattended golf club booking. Josn file attached (with credentials removed).

I attach the automagica log file error again too, and the apps.py file that is referenced, and I think which is causing the error.

I don't know how to get to the PIPED file D:\.....subprocess.py to see what is happening here?

golf booking.txt

automagica error.txt

apps.py.txt

The other thing I did try was to change the locale in the bot to "utf-8" as I could see that referenced in the apps.py file, but it has made no difference.

@kathawala
Copy link

@Fats25

Okay I have a hunch what might be happening here.

Is the file for your job golf_bookkng.txt or golf_booking.json.txt?

If so, try to rename the file to golf_booking.json and rerun the job.

@Fats25
Copy link
Author

Fats25 commented Oct 11, 2020 via email

@kathawala
Copy link

@Fats25

Makes sense. also, just in case, it needs to be .json not .Josn

Exactly .json no capitalization either

@koenvaneijk
Copy link
Contributor

How is your entrypoint defined in the Portal? What is the filename of your main Flow?

@Fats25
Copy link
Author

Fats25 commented Oct 11, 2020

@Fats25

Makes sense. also, just in case, it needs to be .json not .Josn

Exactly .json no capitalization either

It is .json - sorry it was a typo from my phone that I was replying on! (It was autocreated from Automagica Lab).

@Fats25
Copy link
Author

Fats25 commented Oct 11, 2020

Delpoy

How is your entrypoint defined in the Portal? What is the filename of your main Flow?

When I created the process I left that blank. I thought (perhaps mistakenly) that you only needed to specify an entry point when you had other Python code running you needed to run?

With regards to the name of the main flow, I could not find anyway to rename this in Lab. It is therefore called "Unnamed Process". It is named in the Portal.

Both of your responses made me try something else. I renamed the .json file to have no spaces in the name, and created a new process (again with a blank entry point), and it seems to be running now. I had recreated Jobs, and Bots, but for some reason never thought to create the process.

@Fats25
Copy link
Author

Fats25 commented Oct 11, 2020

It was an entry point issue. But also a filename issue.......

The original .json file was called Golf Booking.json - when I tried to create the job I received an error - which is why I tried to leave it blank.

error creating process

When the filename has no spaces (Golf_Booking.json), it works fine.

error creating process.

Thanks for all of your help - this seems to be the issue......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants