extiverse / bazaar

The extension marketplace for your Flarum forum.
https://discuss.flarum.org/d/5151
MIT License
59 stars 14 forks source link

Can't connect my flarum installation to flagrow #136

Open maicol07 opened 4 years ago

maicol07 commented 4 years ago

Steps to reproduce

  1. Install Bazaar
  2. Click the Connect button (plug icon)

Expected behaviour

Bazaar opens a page where you can connect your flagrow account

Actual behaviour

Bazaar opens an about:blank page and write an error in the log (see below)

Configuration

Operating system: Linux Mint 19.2

Version of Bazaar: 0.4 Version of Flarum: 0.1.0-beta9 Other extensions:

Flarum core 0.1.0-beta.9
PHP version: 7.3.9-1+ubuntu18.04.1+deb.sury.org+1
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, sodium, session, standard, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gettext, iconv, json, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, Zend OPcache
+----------------------+---------------+--------+
| Flarum Extensions    |               |        |
+----------------------+---------------+--------+
| ID                   | Version       | Commit |
+----------------------+---------------+--------+
| flarum-approval      | v0.1.0-beta.8 |        |
| flarum-bbcode        | v0.1.0-beta.8 |        |
| flarum-emoji         | v0.1.0-beta.8 |        |
| flarum-lang-english  | v0.1.0-beta.9 |        |
| flarum-flags         | v0.1.0-beta.9 |        |
| flarum-likes         | v0.1.0-beta.9 |        |
| flarum-lock          | v0.1.0-beta.9 |        |
| flarum-markdown      | v0.1.0-beta.9 |        |
| flarum-mentions      | v0.1.0-beta.9 |        |
| flarum-statistics    | v0.1.0-beta.9 |        |
| flarum-sticky        | v0.1.0-beta.9 |        |
| flarum-subscriptions | v0.1.0-beta.9 |        |
| flarum-suspend       | v0.1.0-beta.9 |        |
| flarum-tags          | v0.1.0-beta.9 |        |
| flarum-auth-facebook | v0.1.0-beta.9 |        |
| flarum-pusher        | v0.1.0-beta.9 |        |
| flarum-auth-github   | v0.1.0-beta.9 |        |
| flarum-auth-twitter  | v0.1.0-beta.9 |        |
| extiverse-bazaar     | 0.4.0         |        |
| nearata-lang-italian | v0.1.0-beta.9 |        |
+----------------------+---------------+--------+
Logs:
[2019-09-14 10:56:14] production.ERROR: Exception: Connecting failed in /var/www/html/community/vendor/extiverse/bazaar/src/Api/Controllers/ConnectController.php:35
Stack trace:
#0 /var/www/html/community/vendor/flarum/core/src/Http/RouteHandlerFactory.php(40): Extiverse\Bazaar\Api\Controllers\ConnectController->handle(Object(Zend\Diactoros\ServerRequest))
#1 /var/www/html/community/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(67): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}(Object(Zend\Diactoros\ServerRequest), Array)
#2 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\DispatchRoute->process(Object(Zend\Diactoros\ServerRequest), Object(Closure))
#3 /var/www/html/community/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#4 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\SetLocale->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#5 /var/www/html/community/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(25): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#6 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\CheckCsrfToken->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#7 /var/www/html/community/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(56): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#8 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\AuthenticateWithHeader->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#9 /var/www/html/community/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(34): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#10 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\AuthenticateWithSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#11 /var/www/html/community/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#12 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\RememberFromCookie->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#13 /var/www/html/community/vendor/flarum/core/src/Http/Middleware/StartSession.php(62): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#14 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\StartSession->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#15 /var/www/html/community/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(31): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#16 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Api\Middleware\FakeHttpMethods->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#17 /var/www/html/community/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(29): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#18 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Http\Middleware\ParseJsonBody->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#19 /var/www/html/community/vendor/flarum/core/src/Api/Middleware/HandleErrors.php(42): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#20 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\Api\Middleware\HandleErrors->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#21 /var/www/html/community/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#22 /var/www/html/community/vendor/middlewares/request-handler/src/RequestHandler.php(84): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#23 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\RequestHandler->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#24 /var/www/html/community/vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#25 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\BasePathRouter->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#26 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Middleware/OriginalMessages.php(41): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#27 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Zend\Stratigility\Middleware\OriginalMessages->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#28 /var/www/html/community/vendor/middlewares/base-path/src/BasePath.php(53): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#29 /var/www/html/community/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\BasePath->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\Next))
#30 /var/www/html/community/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\Stratigility\Next->handle(Object(Zend\Diactoros\ServerRequest))
#31 /var/www/html/community/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(72): Zend\Stratigility\MiddlewarePipe->process(Object(Zend\Diactoros\ServerRequest), Object(Zend\Stratigility\EmptyPipelineHandler))
#32 /var/www/html/community/vendor/zendframework/zend-httphandlerrunner/src/RequestHandlerRunner.php(95): Zend\Stratigility\MiddlewarePipe->handle(Object(Zend\Diactoros\ServerRequest))
#33 /var/www/html/community/vendor/flarum/core/src/Http/Server.php(46): Zend\HttpHandlerRunner\RequestHandlerRunner->run()
#34 /var/www/html/community/public/index.php(22): Flarum\Http\Server->listen()
#35 {main}  
luceos commented 4 years ago

That is odd @maicol07 ; can you send me the last digits of the IP where Flarum is installed on?

maicol07 commented 4 years ago

46 if you mean the ones after the last dot

luceos commented 4 years ago

I'll take a look within the next 10 hours, hope you don't mind.

luceos commented 4 years ago

I have been unable to find anything, can you send me your forum domain; if you want to do that privately you can email me (check the composer.json) or chat me up on discord luceos#0001, thanks.

maicol07 commented 4 years ago

It's community.maicol07.it. Don't worry, this URL soon will become public (actually I'm configuring Flarum)

chrisonline commented 4 years ago

I have the same problem. @luceos Did you find the problem already?

luceos commented 4 years ago

I have had little time to look into it. My obligations to Flarum and the continued refactoring towards making flagrow.io extiverse having been making it hard to dive deep into problem solving lately.

I've seen some issues with Bazaar being unable to connect to Flagrow.io; did any of you see more specific errors in the log files?

maicol07 commented 4 years ago

@luceos see my logs in the first post

luceos commented 4 years ago

@maicol07 but you do have a token in your bazaar settings modal?

maicol07 commented 4 years ago

Yes. If I delete it, Bazaar won't work

luceos commented 4 years ago

Okay odd, because that means your connection is blocked somewhere. What hosting environment do you use? And is your DNS dynamic?

maicol07 commented 4 years ago

I use Linux Mint 19.3 (based on Ubuntu 18.04) and yes, unfortunately my DNS is dynamic

luceos commented 4 years ago

I am not sure yet, but the dynamic dns might be the cause.. Do you know how often your IP changes?

maicol07 commented 4 years ago

It changes when everytime modem restarts or when there is maintenance on the network cables

chrisonline commented 4 years ago

I am not sure yet, but the dynamic dns might be the cause.. Do you know how often your IP changes?

I don't have a dynamic IP. I use my own hosting on a Synology NAS.

chrisonline commented 4 years ago

And I don't have a token in my bazaar settings.

luceos commented 4 years ago

Can you check your value of allow_url_fopen?

maicol07 commented 4 years ago

It's On

alihbuzaid commented 4 years ago

I have the same issue on a cpanel hosting strangely enough I had installed @maicol07 wordpress SSO plugin ...I removed it but still the problem did not resolved

luceos commented 4 years ago

@Sndan please provide more information, like your php version, the allow_url_fopen value and the output of php flarum info..

alihbuzaid commented 4 years ago

allow_url_fopen is enabled from cpanel

error logs: [2020-01-29 15:40:23] production.ALERT: Failed Bazaar call to flagrow.io: Internal Server Error
error from JS consol : GET http://forum.xxx.com/api/bazaar/connect net::ERR_INVALID_CHUNKED_ENCODING 200 (OK)

Flarum core 0.1.0-beta.11.1 PHP version: 7.2.26 Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, readline, Reflection, SPL, session, standard, bcmath, bz2, ctype, curl, dba, dom, enchant, mbstring, fileinfo, ftp, gd,gettext, iconv, imap, intl, json, ldap, exif, mysqlnd, odbc, PDO, pgsql, Phar, posix, pspell, shmop, SimpleXML, snmp, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlwriter, xsl, zip, mysqli, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, wddx, xmlreader, xmlrpc, i360, ionCube Loader +----------------------+----------------+--------+ | Flarum Extensions | | | +----------------------+----------------+--------+ | ID | Version | Commit | +----------------------+----------------+--------+ | flarum-approval | v0.1.0-beta.8 | | | flarum-bbcode | v0.1.0-beta.8 | | | flarum-emoji | v0.1.0-beta.10 | | | flarum-lang-english | v0.1.0-beta.11 | | | flarum-flags | v0.1.0-beta.10 | | | flarum-likes | v0.1.0-beta.9 | | | flarum-lock | v0.1.0-beta.9 | | | flarum-markdown | v0.1.0-beta.10 | | | flarum-mentions | v0.1.0-beta.10 | | | flarum-statistics | v0.1.0-beta.9 | | | flarum-sticky | v0.1.0-beta.9 | | | flarum-subscriptions | v0.1.0-beta.9 | | | flarum-suspend | v0.1.0-beta.10 | | | flarum-tags | v0.1.0-beta.11 | | | ziymed-lang-arabic | 0.1.1 | | | extiverse-bazaar | 0.4.1 | | +----------------------+----------------+--------+

alihbuzaid commented 4 years ago

is there a way to install premium plugin without connecting into flagrow ?

luceos commented 4 years ago

@Sndan yes, generate a token in the flagrow.io dashboard and see the instructions under "access token": https://flagrow.io/about/premium-extensions

maicol07 commented 4 years ago

@luceos I have more info about the error pressing the DEBUG button:

GET https://community.maicol07.it/api/bazaar/connect

null

This is the message contained in the modal with error details

luceos commented 4 years ago

@maicol07 Sorry Maicol, this slipped. I am not sure how to resolve this with so little information, a gut feeling might point to your connection to the internet. But I really can't tell from the server or your logs.

Best is to use the token method and use composer directly instead.

dartrax commented 4 years ago

Hi there, I'm having the same problem. Made a fresh install of flarum with pockethold as I can't use composer.

Version of Bazaar: 0.4.1 Version of Flarum: 0.1.0-beta.13 allow_url_fopen is enabled in plesk

Flarum Admin page says "Oops! Something went wrong. Please reload the page and try again." When I open Chrome dev console, I get this:

"Failed to load resource: the server responded with a status of 500"

Also I do not have an API token (https://github.com/extiverse/bazaar/issues/148)

luceos commented 4 years ago

Bazaar is deprecated, flagrow.io is down. Please use composer directly, see https://discuss.flarum.org/d/5151-bazaar-the-extension-marketplace/273

dartrax commented 4 years ago

Aah ok. I didn't know. So I'll have to copy everything to a local place (like xampp I guess), use composer and then load it up again. Still great that I was able to set it up without composer using pockethold as now i'm convinced that it will be worth the effort :) Good job! Flarum is great!