• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

system.callSystem with curl gets stopped by firewall

Engaged ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

Hi

I have created a plugin which uses Gumroads licensing system.

I call the license server like this: system.callSystem('curl https://api.gumroad.com/v2/licenses/verify -d "product_permalink=xxxxxxxxxx" -d "license_key='+licensekey+'" -X POST');

This works for most people and also the computers I have tested it on, but I have a couple of users getting stuck with the error "After Effects warning.  ERROR: The system can not find the file specified".

I highly suspect this is because it is being stopped by the firewall. Is there anything i could do differently which would make it more firewall friendly?

Any suggestions are very welcome.

Jakob Wagner

TOPICS
Scripting

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

I haven't used Gumroad's licensing system (may want to reach out to them on this), but here's a few things to try.

First, narrow down if it is in fact your firewall or not. Disable your firewall and see if it works. If not then that's not the issue.

You said plugin, but since you're using system.callSystem() I suspect you're using a script or CEP extension, is that right? If you're using an extension, you can use the Node.js exec function which has more capabilities and better results than system.callSystem().

var exec = require('child_process').exec;

exec('ipconfig', {encoding: 'UTF-8'}, function(err, res){console.log(res)});

Lastly, the error itself says "The system can not find the file specified", are you reading from a file or are all the variables system variables?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

Thank you for answering.

I haven't been able to recreate the problem on my machines. So it is difficult for me to test.

The "plugin" is a CEP panel and the call is made from Extendscript. It seems a little much to set up a node.js server for this only. Is there any other way to call the cURL from extendscript than to use system.callSystem?

About the error. Licensekey is input by the user, so taken from a input field. Not sure why the error says that.

- Jakob

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

Have you tested the commands in Command Prompt / Terminal to see if they work there first?

That's the only way to make system calls in ExtendScript, but setting up Node.js is pretty easy, and you don't need to set up a whole server, you can just enable it and start using the modules. Just add --enable-nodejs and --mixed-content to your manifest.xml like this:

<?xml version="1.0" encoding="UTF-8"?>

<ExtensionManifest Version="5.0" ExtensionBundleId="com.myName.myPanel" ExtensionBundleVersion="1.0.0" ExtensionBundleName="myPanel"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <ExtensionList>

        <Extension Id="com.myName.myPanel.panel" Version="1.0" />

    </ExtensionList>

    <ExecutionEnvironment>

        <HostList>

            <Host Name="AEFT" Version="13.0" />

        </HostList>

        <LocaleList>

            <Locale Code="All" />

        </LocaleList>

        <RequiredRuntimeList>

            <RequiredRuntime Name="CSXS" Version="5.0" />

        </RequiredRuntimeList>

    </ExecutionEnvironment>

    <DispatchInfoList>

        <Extension Id="com.myName.myPanel.panel">

            <DispatchInfo >

                <Resources>

                    <MainPath>./ui/index.html</MainPath>

                    <ScriptPath>./main.jsx</ScriptPath>

                    <CEFCommandLine>

                        <Parameter>--enable-nodejs</Parameter>

                        <Parameter>--mixed-context</Parameter>

                    </CEFCommandLine>

                </Resources>

                <Lifecycle>

                    <AutoVisible>true</AutoVisible>

                </Lifecycle>

                <UI>

                    <Type>Panel</Type>

                    <Menu>myPanel</Menu>

                    <Geometry>

                        <Size>

                            <Height>500</Height>

                            <Width>500</Width>

                        </Size>

                    </Geometry>

                </UI>

            </DispatchInfo>

        </Extension>

    </DispatchInfoList>

</ExtensionManifest>

Then you can require any Node module you like and start using it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

I have tested in the command prompt and they work. But my method also works for most installs. It is only a few that gets caught by the firewall. I wonder if it will make a difference to use node.js, but I'll try it.

Thank you for describing the process, that is actually much easier than I thought it was.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

I'm still not convinced it is your Firewall blocking it. Have you had a chance to turn it off to see if it works? The functionality should be the same, I've heard of people running into a lot more issues with system.callSystem() than with exec().

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 01, 2019 May 01, 2019

Copy link to clipboard

Copied

I'm not convinced either, but at least two of the three users with this problem have Symantec Endpoint Protection. As said, it works for me on all systems I have checked, just not for those three users.

I tried this:

var exec = require('child_process').exec;

exec('curl https://api.gumroad.com/v2/licenses/verify -d "product_permalink=ccPHNO" -d "license_key=F7FE8AA3-6037486B-B69A2C8A-02B97788" -X POST', {encoding: 'UTF-8'}, function(err, stdout, stderr){alert(stderr)});

I get the error: 'curl' is not recognized as an internal or external command, operable program or batch file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2019 May 01, 2019

Copy link to clipboard

Copied

Hmm, sounds like it's not seeing curl. Do you have curl installed as an Environment Variable? What OS are you using? Do you get the same error if you just run this?

var exec = require('child_process').exec;

exec('curl', {encoding: 'UTF-8'}, function(err, stdout, stderr){alert(stderr)});

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 04, 2019 May 04, 2019

Copy link to clipboard

Copied

Sorry for long wait. That will return the same error.

Another thing. If i enable node js in the manifest. This event wont run anymore:

$(document).ready(function()

{

     // do things

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 04, 2019 May 04, 2019

Copy link to clipboard

Copied

Make sure to include:

<Parameter>--mixed-context</Parameter>

Regarding Curl, are you on Windows or Mac? Because I know on my PC Curl you have to install separately, wondering if GumRoad has another way of accessing their licensing server than Curl...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 05, 2019 May 05, 2019

Copy link to clipboard

Copied

You're right! Curl is only available on Windows 10 17063 and above. Dammit. That is why it works for most users, and myself.

I'm in contact with Gumroad to see if there should be another way. If there isn't I need to find a way to include curl in the installer.

As a quick fix I have ask the users with the problem to install curl from here: cURL for Windows: a Windows Installer for the Web Transfer Tool and that seems to work.

Thank you very much for helping me!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2019 May 05, 2019

Copy link to clipboard

Copied

LATEST

Glad you found a workaround for this, but I'm sure there's a better way as lots of AE script authors use Gumroad for their licensing. Possibly through an http request or something of the sort. Let us know if you find the solution

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines