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

Segment filter not saved or editable. #10947

Closed
1 task done
TechBill opened this issue Mar 9, 2022 · 33 comments · Fixed by #10985
Closed
1 task done

Segment filter not saved or editable. #10947

TechBill opened this issue Mar 9, 2022 · 33 comments · Fixed by #10985
Labels
bug Issues or PR's relating to bugs regression A bug that broke something in the last release segments Anything related to segments
Milestone

Comments

@TechBill
Copy link

TechBill commented Mar 9, 2022

Mautic Version

4.2.x series

PHP version

7.4

What browsers are you seeing the problem on?

Chrome

What happened?

We create a tag to apply it to contacts then we wanted to create a Contact Segment filtered by a tag but the segment filter is not being saved or producing a filter box to apply to the segment.

How can we reproduce this issue?

Step 1: Create a new Contact Segment
Step 2: Give it a name then go to filter tab
Step 3: Select any filter.

Filter input box never appear or saved in filter tab when a filter is selected from the drop down menu.

Relevant log output

No response

Code of Conduct

  • I confirm that I have read and agree to follow this project's Code of Conduct
@TechBill TechBill added bug Issues or PR's relating to bugs needs-triage For new issues/PRs that need to be triaged labels Mar 9, 2022
@TechBill
Copy link
Author

TechBill commented Mar 9, 2022

Got this one sorted ...

The server had shell function restricted so I had to remove the restriction from the shell function since it seems that Mautic needed those shell function to work.

I believed it needed the shell_exec but I disabled the restriction on all of it and the filter condition box finally appeared ...

Screen Shot 2022-03-09 at 2 05 36 PM

@TechBill
Copy link
Author

TechBill commented Mar 9, 2022

If you use cPanel and experience the similar issue I was having, you will need to go to the root access of the cPanel "WHM" and remove all those functions from "Disable" box because it seems that Mautic need some of those function to work property. I removed restriction from all of it but I suspect it was the shell_exec that Mautic needed to have access to.

If you don't have root access then you need to contact your server administrator ...

@TechBill
Copy link
Author

TechBill commented Mar 9, 2022

WELP ... I spoke too soon ...

Segment filter condition box does not appear when a filter is selected in the drop down menu.

Probably missing some php extension .. is there a list of required extension online somewhere?

@TechBill
Copy link
Author

TechBill commented Mar 9, 2022

This issue still remains and still an issue

Here what in log now

[2022-03-09 21:36:49] mautic.ERROR: STAT UPDATE: Error communicating with the stat server: 524 (Origin Time-out) [] []

And the server log

[09-Mar-2022 19:07:47 UTC] PHP Warning: require(/home/agwmadmin/mas.agwm.org/vendor/autoload.php): failed to open stream: No such file or directory in /home/agwmadmin/mas.agwm.org/autoload.php on line 13
[09-Mar-2022 19:07:47 UTC] PHP Fatal error: require(): Failed opening required '/home/agwmadmin/mas.agwm.org/vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/agwmadmin/mas.agwm.org/autoload.php on line 13
[09-Mar-2022 19:08:05 UTC] PHP Warning: require(/home/agwmadmin/mas.agwm.org/vendor/autoload.php): failed to open stream: No such file or directory in /home/agwmadmin/mas.agwm.org/autoload.php on line 13
[09-Mar-2022 19:08:05 UTC] PHP Fatal error: require(): Failed opening required '/home/agwmadmin/mas.agwm.org/vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/agwmadmin/mas.agwm.org/autoload.php on line 13
[09-Mar-2022 19:08:22 UTC] PHP Warning: require(/home/agwmadmin/mas.agwm.org/vendor/autoload.php): failed to open stream: No such file or directory in /home/agwmadmin/mas.agwm.org/autoload.php on line 13
[09-Mar-2022 19:08:22 UTC] PHP Fatal error: require(): Failed opening required '/home/agwmadmin/mas.agwm.org/vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/agwmadmin/mas.agwm.org/autoload.php on line 13
[09-Mar-2022 19:08:24 UTC] PHP Warning: require(/home/agwmadmin/mas.agwm.org/vendor/autoload.php): failed to open stream: No such file or directory in /home/agwmadmin/mas.agwm.org/autoload.php on line 13
[09-Mar-2022 19:08:24 UTC] PHP Fatal error: require(): Failed opening required '/home/agwmadmin/mas.agwm.org/vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/agwmadmin/mas.agwm.org/autoload.php on line 13

@donbowman
Copy link

donbowman commented Mar 10, 2022

I am also seeing this issue. I don't see the autoload errors tho.
4.1.x was fine. 4.2.x shows this error, rending segments unusable.

This is a client (javascript) side i think, there's no console errors, no communication to backend.

@ghost
Copy link

ghost commented Mar 10, 2022

image
+1
But this problem appear only on my brand new instance with php 7.4.28. Problem doesn't exist on my old instance, where I made update. Old instance php:7.4.3

@TechBill
Copy link
Author

TechBill commented Mar 10, 2022

This issue is still ongoing and I noticed there're more new posts about this issue from others.

@mautibot
Copy link

This issue has been mentioned on Mautic Community Forums. There might be relevant details there:

https://forum.mautic.org/t/create-new-segment-filter-4-2-rc-front-end-issue-on-filter/22785/3

@TechBill
Copy link
Author

Same issue on different server which I have root access to ...

Composer installed Mautic have some type of issue of saving or creating conditions for Segment filters ..

@donbowman
Copy link

OK, so the fix for me.
I ran 'mautic:assets:generate' followed by 'assets:install'.

Although i was rebuilding from source in a container, so thus fresh, the media dir was from previous ver and thus dirty.

@TechBill
Copy link
Author

This also what fixes it for me ... the command i use to fix it was

php console mautic:assets:generate

@PierreAmmeloot
Copy link
Contributor

Hello,

I have same problem.
Capture d’écran 2022-03-15 à 18 47 31

I have this error message on inspector (Chrome) :

app.js?vb853d28b:657 Uncaught ReferenceError: filterId is not defined
    at Object.Mautic.convertLeadFilterInput (app.js?vb853d28b:657:1086)
    at Object.Mautic.addLeadListFilter (app.js?vb853d28b:664:751)
    at HTMLSelectElement.<anonymous> (app.js?vb853d28b:648:132)
    at HTMLSelectElement.dispatch (libraries.js?vb853d28b:465:447)
    at HTMLSelectElement.elemData.handle (libraries.js?vb853d28b:451:166)
    at Object.trigger (libraries.js?vb853d28b:682:227)
    at HTMLSelectElement.<anonymous> (libraries.js?vb853d28b:688:258)
    at Function.each (libraries.js?vb853d28b:153:170)
    at jQuery.fn.init.each (libraries.js?vb853d28b:144:192)
    at jQuery.fn.init.trigger (libraries.js?vb853d28b:688:229)

Pierre

@RCheesley
Copy link
Sponsor Member

@PierreAmmeloot did regenerating the assets resolve the issue?

@PierreAmmeloot
Copy link
Contributor

Hello @RCheesley,

I have use this command line :

php bin/console mautic:assets:generate

With this result :
Production assets have been regenerated.

The issue persists.
I have this problem sporadically, sometimes the field is displayed correctly. Other times not.

Pierre

@RCheesley
Copy link
Sponsor Member

Hmm, assuming you're not using any kind of caching server-side or anything like Cloudflare which might need purging? Sounds somewhat similar to #10962.

@RCheesley RCheesley added segments Anything related to segments regression A bug that broke something in the last release and removed needs-triage For new issues/PRs that need to be triaged labels Mar 16, 2022
@RCheesley RCheesley added this to the 4.2.1 milestone Mar 16, 2022
@PierreAmmeloot
Copy link
Contributor

Hello @RCheesley, I confirm : I'm not using any kind of caching or anything like Cloudflare.

I have this problem on another filter :
Capture d’écran 2022-03-16 à 16 37 37

Could this have anything to do with the changes @kuzmany made to the filters on Mautic 4.2.0?

Pierre

@RCheesley
Copy link
Sponsor Member

We had some pretty major segment refactoring in 4.2 and we will be investigating these issues as it doesn't seem to be consistent for everyone. We've got a couple of other things which are higher priority at this moment but hope to be able to get to it during the Open Source Friday community sprint on Friday. If you're able to join us with any developers that would be really helpful!

@PierreAmmeloot
Copy link
Contributor

Hello @RCheesley,

Thanks for your feedback.
In view of my investigations, it looks like a bug (or at least a functional regression).
If I can help by testing it, I'd love to.

Pierre

@escopecz
Copy link
Sponsor Member

@PierreAmmeloot I cannot reproduce
Screen Shot 2022-03-21 at 15 06 08
So you'll have to dig up an error message we can catch for more details or steps to reproduce it. Is there anything related in the Mautic logs? Is there anything failing in JS when you open the browser's dev tools console?

@escopecz
Copy link
Sponsor Member

Please test #10985 if it will fix your problem

@RCheesley
Copy link
Sponsor Member

@PierreAmmeloot @TechBill @biggala2310 @donbowman please can you test this PR: #10985 and if it resolves the issue please report that on the PR so we can get it merged on Monday with 4.2.1.

You can use the Gitpod button on the PR to spin up a Mautic instance with the PR applied in order to test quickly - or pull down the PR to test locally.

Please ensure to test with dev mode - append /index_dev.php to the URL - so that you're not needing to faff about with regenerating assets.

@ghost
Copy link

ghost commented Mar 28, 2022

@RCheesley for my instance mautic:assets:generate was enough. I was surprised that I need it in a fresh Mautic.

@RCheesley
Copy link
Sponsor Member

Closing this issue as the PR has been merged and will be released in 4.2.1.

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If this issue is continuing with the lastest stable version of Mautic, please open a new issue that references this one.

@PierreAmmeloot
Copy link
Contributor

Hello,

I have uptaded Mautic on 4.2.1 version.

I have the same bug :
Capture d’écran 2022-04-01 à 22 33 31

So I tried:

php bin/console mautic:assets:generate
It's done ✅ => Production assets have been regenerated.

php bin/console assets:install

With this error message :

The target directory "/var/www/vhosts/***/httpdocs/public" does not exist.

I can read this on my error log :

[2022-04-01 20:35:42] mautic.NOTICE: Symfony\Component\Console\Exception\InvalidArgumentException: The target directory "/var/www/vhosts/***/httpdocs/public" does not exist. (uncaught exception) at /var/www/vhosts/***/httpdocs/vendor/symfony/framework-bundle/Command/AssetsInstallCommand.php line 112 while running console command assets:install [] []

What can I do to get back to working normally?

Pierre

P.S.: @RCheesley can you reopen this ticket?

@RCheesley
Copy link
Sponsor Member

RCheesley commented Apr 2, 2022

Replying on a closed issue is not helpful. Please raise a new issue or post in the forums if you're not sure it's a bug. Sounds like you fixed the problem by regenerating the assets, so no need to reopen the issue.

Why are you running mautic:assets:install in the first place? This command is not required and is nothing to do with the regeneration of the JS and CSS, which is what the mautic:assets:generate command does. I've no idea why it would be throwing that error because I've never seen that command actually being used and I have no idea what it actually does.

@PierreAmmeloot
Copy link
Contributor

Hello @RCheesley

Replying on a closed issue is not helpful. 

As this issue is supposed to fix the problem and it doesn't, it seems appropriate to post here rather than opening a new bug. Next time, would you prefer me to open a separate issue?

Please raise a new issue or post in the forums if you're not sure it's a bug. Sounds like you fixed the problem by regenerating the assets, so no need to reopen the issue.

As I show in my message, no action on the "assets" can correct the point.
What more can I do than what I present in my message?

Why are you running mautic:assets:install in the first place? This command is not required and is nothing to do with the regeneration of the JS and CSS, which is what the mautic:assets:generate command does. I've no idea why it would be throwing that error because I've never seen that command actually being used and I have no idea what it actually does.

The command: php bin/console mautic:assets:install does not seem to exist in Mautic.
The error message returned is this:

Command "mautic:assets:install" is not defined.

  Did you mean one of these?                       
      assets:install                               
      mautic:assets:generate                       
      mautic:install                               
      mautic:marketplace:install                   
      mautic:plugins:install        

Tell me how I can get the point back to the right place by following the correct procedure.

Pierre

@adorosario
Copy link

This issue is still persisting in 4.2.1 - should we open a new bug ? Exactly as described by @PierreAmmeloot above.

@adorosario
Copy link

Sorry - but is there a workaround for this issue?

image

@escopecz
Copy link
Sponsor Member

Is there any chance you saved the segment in this state when there was the issue? If you create the same filter now, does it still happen?

Also, please make sure that the browser cache is cleared after you run bin/console mautic:assets:generate. The old JS can be stored in browser cache.

@adorosario
Copy link

Is there any chance you saved the segment in this state when there was the issue? If you create the same filter now, does it still happen?

Also, please make sure that the browser cache is cleared after you run bin/console mautic:assets:generate. The old JS can be stored in browser cache.

Its a fresh 4.2.1. install on the day that the issue happened. So its not an old segment.

UPDATE: Now magically the buttons appeared. So looks like it could be a timing issue with the cron jobs and the cache - or stored JS in the browser cache. Not really sure what exactly solved the problem.

But maybe the following sequence should help other users maybe?

  1. bin/console mautic:assets:generate
  2. Delete mautic /var/cache on server
  3. Open new browser window in incognito mode

@PierreAmmeloot
Copy link
Contributor

Hello @adorosario,

I have follow your instructions (on Mautic v4.2.1).
On my existing segment, I still have the same problem...
I don't think the problem is with the browser cache.

I have created a new segment and the field appears correctly.
I have cloned the segment that was giving me problems and the new segment is displaying OK.

So I think the problem is with the Mautic update.
What do you think?

Pierre

@adorosario
Copy link

Hello @adorosario,

I have follow your instructions (on Mautic v4.2.1). On my existing segment, I still have the same problem... I don't think the problem is with the browser cache.

I have created a new segment and the field appears correctly. I have cloned the segment that was giving me problems and the new segment is displaying OK.

So I think the problem is with the Mautic update. What do you think?

Pierre

You could be right. Unfortunately, I am not familiar with the Mautic source (I'm more of a consumer) -- so maybe one of the contributors might be able to help. Your analysis should be very useful (if this is happening only on existing segments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs regression A bug that broke something in the last release segments Anything related to segments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants