Action route not available from URL. What do I have wrong? I built a plugin for Craft 3 and need to run one of its actions via CRON. I know I can set this up as a console command, and will do that, but before I get there, I'd like to solve this issue.

I noticed my CRON was failing, and when I attempted to run the URL myself, at http://campaigns.gcx.loc/actions/gcxCampaignTools/stats/syncCampaignsRemote, I got this error:

yii\base\InvalidRouteException: Unable to resolve the request "gcxCampaignTools/stats/syncCampaignsLocal". in /Users/Chad/Sites/gcx-campaigns/vendor/yiisoft/yii2/base/Module.php:537
Stack trace:
#0 /Users/Chad/Sites/gcx-campaigns/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module-&gt;runAction('gcxCampaignTool...', Array)
#1 /Users/Chad/Sites/gcx-campaigns/vendor/craftcms/cms/src/web/Application.php(566): craft\web\Application-&gt;runAction('gcxCampaignTool...', Array)
#2 /Users/Chad/Sites/gcx-campaigns/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application-&gt;_processActionRequest(Object(craft\web\Request))
#3 /Users/Chad/Sites/gcx-campaigns/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application-&gt;handleRequest(Object(craft\web\Request))
#4 /Users/Chad/Sites/gcx-campaigns/public_html/index.php(21): yii\base\Application-&gt;run()
#5 {main}

Next yii\web\NotFoundHttpException: Page not found. in /Users/Chad/Sites/gcx-campaigns/vendor/craftcms/cms/src/web/Application.php:570
Stack trace:
#0 /Users/Chad/Sites/gcx-campaigns/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application-&gt;_processActionRequest(Object(craft\web\Request))
#1 /Users/Chad/Sites/gcx-campaigns/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application-&gt;handleRequest(Object(craft\web\Request))
#2 /Users/Chad/Sites/gcx-campaigns/public_html/index.php(21): yii\base\Application-&gt;run()
#3 {main}


The action works from a front end link with the following code when I am logged in (user must be logged in to use the entire app, so login is required to run the action as well):

&lt;a href="/actions/gcx-campaign-tools/stats/sync-campaigns-local"&gt;Sync Campaigns&lt;/a&gt;

Because it worked when logged in, I thought I may need to allow anonymous in the controller, but that was already in place. I tried both protected $allowAnonymous = true; and protected $allowAnonymous = ['actionSyncCampaignsRemote']; with the same results.

Here is a screenshot of my plugin file structure and controller actions: screenshot

As you can see there I did put URL: /actions/gcx-campaign-tools/stats/sync-campaigns-remote in the code comments when I built this. Loading that URL produces the same error.

What am I missing here?
Turns out the controller action was running, but since I was just using return, Craft was looking for a template to show once the functions were complete, and failing when it didn't find one. Using die(); after the function runs is working fine.