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

Custom plugin directory not working properly on some plugins #15340

Closed
JugurthaK opened this issue Jan 2, 2020 · 11 comments
Closed

Custom plugin directory not working properly on some plugins #15340

JugurthaK opened this issue Jan 2, 2020 · 11 comments
Labels
worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@JugurthaK
Copy link

Hello,

This issue is related to Issue#14717 ;

When going to premium plugins as ABTesting or SessionRecording on left panel, I've an error referring to a 404 with the following path : ./custom-folder//HeatmapSessionRecording/angularjs

When we've initialized our custom folder, it was without any "/" at the end,

Regards,

@tsteur
Copy link
Member

tsteur commented Jan 2, 2020

Could you let us know how you configured your Matomo On-Premise re the paths? Be great to know roughly the structure of the Matomo path and the custom plugin path.

Also: Are you using the latest version of Matomo? As we fixed some things there

@JugurthaK
Copy link
Author

Hello

Currently working on 3.13.0 (latest version on Docker Hub); since I'm using the Docker image, my custom path is defined as an envvar.

The custom directory and the Matomo plugins directory are at the same level, so at the root of Matomo.
Moreover, Funnels is working properly and its on the same folder as AbTesting or HeatMapSession.

Thank you,

@tsteur
Copy link
Member

tsteur commented Jan 3, 2020

It's a bit funny it works with Funnel but not with the other two plugins. I'm using it here with HeatmapSessionRecording and Funnels in a custom plugin dir and it works nicely.

In case you are familiar with the browser developer tools, in the console could you enter piwik.relativePluginWebDirs and paste here what the outcome is?

And is ./custom-folder//HeatmapSessionRecording/angularjs the full resource that is being requested? Is there no JS or HTML file attached in the path?

I suppose as a result these plugins don't work for you in the Matomo UI?

@JugurthaK
Copy link
Author

In case you are familiar with the browser developer tools, in the console could you enter piwik.relativePluginWebDirs and paste here what the outcome is?

AbTesting: "./additional-plugins/"
ActivityLog: "./additional-plugins/"
Funnels: "./additional-plugins/"
HeatmapSessionRecording: "./additional-plugins/"
LoginSaml: "./additional-plugins/"
QueuedTracking: "./additional-plugins/"
ReferrersManager: "./additional-plugins/"
TasksTimetable: "./additional-plugins/"
UsersFlow: "./additional-plugins/"

And is ./custom-folder//HeatmapSessionRecording/angularjs the full resource that is being requested? Is there no JS or HTML file attached in the path?

There is an HTML file attached,

I suppose as a result these plugins don't work for you in the Matomo UI?

No they're not unfortunately,

tsteur added a commit that referenced this issue Jan 6, 2020
Otherwise generates a URL like `https://example.com/additional-plugins//AbTesting/angularjs/manage/manage.directive.html?cb=303`

In https://github.com/matomo-org/matomo/blob/3.13.1-b2/plugins/CoreHome/angularjs/http404check.js#L29 there will be otherwise `['./additional=plugins/', 'AbTesting', '...'].join()`. The `pluginsToWebRootDirCache ` is only used for that purpose. 

refs #15340
This should not fix the referenced issue as a double slash should not cause any issue AFAIK but be still good to make that right. The `$pluginsToWebRootDirCache ` is only used for that purpose to load these files through http404check
@tsteur
Copy link
Member

tsteur commented Jan 6, 2020

So it is trying to load https://example.com/additional-plugins/AbTesting/angularjs/manage/manage.directive.html

and https://example.com/additional-plugins/HeatmapSessionRecording/angularjs/manageSession/manage.directive.html?

And these return a 404 error. Do you know what the correct URL should be that works? For me everything seems to be working fine so far. Are these plugins basically located in a directory named additional-plugins in the Matomo root dir? With other directories like plugins, lang, js, config on the same level (which you already mentioned I think but be good to have this double confirmed)?

Because if so, it looks like Matomo generates the correct URL but it might be a webserver issue that these files cannot be found?

diosmosis pushed a commit that referenced this issue Jan 8, 2020
Otherwise generates a URL like `https://example.com/additional-plugins//AbTesting/angularjs/manage/manage.directive.html?cb=303`

In https://github.com/matomo-org/matomo/blob/3.13.1-b2/plugins/CoreHome/angularjs/http404check.js#L29 there will be otherwise `['./additional=plugins/', 'AbTesting', '...'].join()`. The `pluginsToWebRootDirCache ` is only used for that purpose. 

refs #15340
This should not fix the referenced issue as a double slash should not cause any issue AFAIK but be still good to make that right. The `$pluginsToWebRootDirCache ` is only used for that purpose to load these files through http404check
@JugurthaK
Copy link
Author

JugurthaK commented Jan 13, 2020

Hello,

As i've seen in your commit, my problem will not be solved because of this "//".
Sure it'll be something due to my http server, I'll check it with my team !

Thank you very much for your precious help.

@tsteur
Copy link
Member

tsteur commented Jan 13, 2020

If the double slash won't solve it, it be great to know what the URL should look like. This way we can better understand what is going wrong.

@mattab mattab added the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Jan 21, 2020
@mattab mattab added this to the 4.2.0 milestone Jan 21, 2020
@JugurthaK
Copy link
Author

Hello guys,

I've checked our nginx config, the .html files are allowed from any source. But I've seen in our logs that sometimes they're requests to the plugins from the classical folder and not the custom one.

I dont think the issue is on your side anymore, if I find how to solve it, I will let you know !

Regards,

@tsteur
Copy link
Member

tsteur commented Jan 22, 2020

Awesome, that be really great as it will help when others face this issue. I will close the issue for now but be great if you could still commend about what you find and we can reopen the issue also any time if needed.

@tsteur tsteur closed this as completed Jan 22, 2020
@tsteur tsteur added worksforme The issue cannot be reproduced and things work as intended. and removed Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. labels Jan 22, 2020
@JugurthaK
Copy link
Author

Hello guys,

I'm a man of word, so i've finally found the issue. Our matomo is not in the same container as our nginx, and the nginx container had a additional-plugins folder, but it was empty..

To solve it, I've just binded the volume containing the custom plugins to Matomo and Nginx and its working properly.

Regards,

@tsteur
Copy link
Member

tsteur commented Jan 30, 2020

Awesome @JugurthaK Thanks a lot for making the effort to letting us know. Very appreciated 👍

@mattab mattab modified the milestones: 4.2.0, 4.0.0 Sep 9, 2020
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this issue Sep 22, 2020
Otherwise generates a URL like `https://example.com/additional-plugins//AbTesting/angularjs/manage/manage.directive.html?cb=303`

In https://github.com/matomo-org/matomo/blob/3.13.1-b2/plugins/CoreHome/angularjs/http404check.js#L29 there will be otherwise `['./additional=plugins/', 'AbTesting', '...'].join()`. The `pluginsToWebRootDirCache ` is only used for that purpose. 

refs matomo-org#15340
This should not fix the referenced issue as a double slash should not cause any issue AFAIK but be still good to make that right. The `$pluginsToWebRootDirCache ` is only used for that purpose to load these files through http404check
jbuget pushed a commit to 1024pix/pix-analytics that referenced this issue Sep 26, 2020
Otherwise generates a URL like `https://example.com/additional-plugins//AbTesting/angularjs/manage/manage.directive.html?cb=303`

In https://github.com/matomo-org/matomo/blob/3.13.1-b2/plugins/CoreHome/angularjs/http404check.js#L29 there will be otherwise `['./additional=plugins/', 'AbTesting', '...'].join()`. The `pluginsToWebRootDirCache ` is only used for that purpose. 

refs matomo-org#15340
This should not fix the referenced issue as a double slash should not cause any issue AFAIK but be still good to make that right. The `$pluginsToWebRootDirCache ` is only used for that purpose to load these files through http404check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

3 participants