ssplugin / ss-twitter-feed

Show Recent twitter timeline on your site.
MIT License
3 stars 7 forks source link

Local hosting bug - Headers already sent in #31

Open wallythewebdev opened 2 years ago

wallythewebdev commented 2 years ago

Hi there :)

I'm trying to Authenticate the SS twitter feed plugin, while developing in a Localhosted environment (nitro).

When I click to Authenticate from Settings I am given a error:

Any help figuring out next steps would be great.

An Error occurred while handling another error:
yii\web\HeadersAlreadySentException: Headers already sent in /app/vendor/ssplugin/ss-twitter-feed/src/controllers/OauthController.php on line 93. in /app/vendor/yiisoft/yii2/web/Response.php:368
Stack trace:
#0 /app/vendor/yiisoft/yii2/web/Response.php(341): yii\web\Response->sendHeaders()
#1 /app/vendor/yiisoft/yii2/web/ErrorHandler.php(136): yii\web\Response->send()
#2 /app/vendor/craftcms/cms/src/web/ErrorHandler.php(192): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#3 /app/vendor/yiisoft/yii2/base/ErrorHandler.php(135): craft\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#4 /app/vendor/craftcms/cms/src/web/ErrorHandler.php(71): yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#5 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#6 {main}
Previous exception:
yii\base\InvalidRouteException: Unable to resolve the request: ss-twitter-feed/oauth/callback&oauth_token=XXXXXXXXXXXXXXXXXXXXoauth_verifier=XXXXXXXXXXXXXXXXXXX in /app/vendor/yiisoft/yii2/base/Controller.php:149
Stack trace:
#0 /app/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('callback&oauth_...', Array)
#1 /app/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('ss-twitter-feed...', Array)
#2 /app/vendor/craftcms/cms/src/web/Application.php(602): craft\web\Application->runAction('ss-twitter-feed...', Array)
#3 /app/vendor/craftcms/cms/src/web/Application.php(272): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#4 /app/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#5 /app/web/index.php(12): yii\base\Application->run()
#6 {main}

Next yii\web\NotFoundHttpException: Page not found. in /app/vendor/craftcms/cms/src/web/Application.php:606
Stack trace:
#0 /app/vendor/craftcms/cms/src/web/Application.php(272): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#1 /app/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#2 /app/web/index.php(12): yii\base\Application->run()
#3 {main}

I thought this might have been caused by not having a SSL for the local hosting environment - so I added SSL via Nitro trust.

I can Authenticate the plugin if it is on my testing server (live on the web) - So I did that and took the Auth tokens from the live version and added them to the Localhost version - this did not work, I am given the twig output on my template:

image

There are not found any tweets yet.

Doe this plugin work on local hosted environments? Can you copy authentication keys or do they have to been linked to the Craft install they where installed on?

Thanks - W

scott-ansell-halo commented 2 years ago

Having the exact same issue here. The oAuth callback URL is correct. Same experience on a local and hosted environment.

SS Twitter: 1.0.8 Craft CMS: 3.7.33

wallythewebdev commented 2 years ago

@scott-ansell-halo Is this only happening to you on the local host or are you having this issue online as well? Can't really help debug the issue but this is a blocking task for me so wondering if its time to look at some alternatives encase.

scott-ansell-halo commented 2 years ago

@wallythewebdev having the same experience on a local and hosted environment. This is also a blocking task for me. I think there are some good alternatives out there. I'd like to see this issue resolved though.

wallythewebdev commented 2 years ago

@SSTwitterFeed @ssplugin - Sorry to prompt, but could you provide some insight into this, its time sensitive. Thanks :)

ssplugin commented 2 years ago

@wallythewebdev @scott-ansell-halo Thanks for reporting the issue. We would like to investigate this issue so could you provide exact information like when the error occurred? For further debugging please send web.log file or any other error log file to ssplugins.seeders@gmail.com Also, Which PHP version is used with craft cms installation?

wallythewebdev commented 2 years ago

HI @SSTwitterFeed

PHP version | 8.0.16 Craft Solo 3.7.37

I'm not sure what you mean by 'when the error occurred?' - It is after I try to Authenticate the SS Twitter Feed plugin. To break it down into parts.

1) Click 'Connect to twitter and get acsess token' 2) Redirected to an authorization page with button:

image

3) Click Authorize app 4) Briefly am shown a screen saying redirecting to the app 5) Error message is presented (the one in my question at the top).

Thanks