Module enabled, but commands missing

Topics: General, Writing modules
Dec 7, 2012 at 1:14 AM

I'm using the updated Orchard.Disqus module (which you can find here) to enable Disqus for my Orchard 1.6 site. The module is installed and appears to be functioning properly, but none of the comments are showing up.

The module includes a command ("disqus comments import"), but although Orchard.Disqus is showing up as enabled when I open the command line tool and use:

feature list /Summary:true

if I try to execute the command, I get the response: 'No command found matching arguments "disqus comments import".'

As far as I can tell from checking the source, the command should work, but for some reason Orchard isn't making the command available.

Am I missing something about how commands get wired up? If a module is installed properly, and has a command that inherits from DefaultOrchardCommandHandler, what would prevent that command from being available in the CLI?

Coordinator
Dec 7, 2012 at 1:17 AM

No, that should work. Anything in logs?

Dec 7, 2012 at 1:30 AM
Edited Dec 7, 2012 at 1:49 AM
bertrandleroy wrote:

No, that should work. Anything in logs?


I checked the logs, but didn't see anything that was obviously related. I tested by renaming the old log, starting a new command line session and attempting to execute the command again. Unfortunately, nothing's showing up in the log when I attempt to execute the command.

BTW, the code for the commands is super-simple, and can be viewed here:

https://github.com/jkernech/Orchard.Disqus/blob/master/Commands/DisqusCommands.cs

To clarify...the module code doesn't specifically need to be built with Orchard itself, correct?

Any other suggestions for troubleshooting commands?

PS - This is a clean install of 1.6, with content imported via the import/export module. I was having some issues with my existing Orchard site, which I had upgraded from an earlier version.

Dec 7, 2012 at 1:45 AM
Edited Dec 7, 2012 at 1:45 AM

I did find the following in the logs, but the time of the exception is way earlier than when I was working with the command line:

2012-12-06 15:24:46,662 [13] Orchard.Exceptions.DefaultExceptionPolicy - An unexpected exception was caught
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Orchard.OrchardCoreException: Recipe execution with id 95699c3296964b21bb1ddcd07f03fb87 was cancelled because the "Feature" step failed to execute. The following exception was thrown: Sequence contains no matching element. Refer to the recipe journal for more information.

Could the above be an exception that occurred during installation of the module? Where would I find the recipe journal to look for more information?

Coordinator
Dec 7, 2012 at 6:34 AM

Is there an OrchardFeature attribute on the command's class?

Dec 7, 2012 at 10:22 AM

No, but going through the other modules, I noticed that there are several that do not, but whose commands work fine (blog module, themes module, etc.).

I tried adding one, like so:

    [OrchardFeature("Orchard.Disqus")]
    public class DisqusCommands : DefaultOrchardCommandHandler

but it made no difference in the behavior of the command line tool. Still gives me the same error message.

Based on this issue filed:

https://github.com/jkernech/Orchard.Disqus/issues/1

it's pretty clear that the wiring up of the command worked for someone, even if they had issues with the actual import process.

Other ideas?  


Coordinator
Dec 8, 2012 at 10:18 PM

The only way to sort this out is probably to attach a debugger and step into the code that discovers the commands. Probably best to file a bug in any case.

Dec 9, 2012 at 2:46 PM

I have the same issue. 

The module is installed but doesn't seem to work/show or anything!!

Coordinator
Dec 9, 2012 at 7:25 PM

Please file a bug.

Dec 9, 2012 at 10:04 PM

Bug filed:

http://orchard.codeplex.com/workitem/19334

And created a clean workflow for a repro.

Coordinator
Dec 9, 2012 at 10:25 PM

Thanks! Much appreciated.

Jan 27, 2013 at 2:47 PM

Any news on this ?  I just migrated to 6.0 ... having same problem ... Disqus comments enabled, but do not appear .... 

AND CHECK THIS OUT ... DISQUS COMMENTS WORK WHEN USING WEBMATRIX .... the go back to IIS ... not only does Disqus not show up for posting a new comment ... but the comment does not show up on the blog page ...

Bertrand ... No action on this in over a month ???  What's going on ??  I can't go into production without Disqus ... please escalate the priority ... 

Developer
Jan 27, 2013 at 4:24 PM

Please note that this bug is scheduled for Orchard 1.7, However if you need help right now are you able to debug? I can tell you where to put break points etc...

Developer
Jan 27, 2013 at 4:37 PM

I have looked at the bug and cannot reproduce. Can someone tell me if I have done anything wrong? - All info on the Issue. http://orchard.codeplex.com/workitem/19334

Coordinator
Jan 27, 2013 at 7:32 PM

@tsaltd: thanks for filing the bug. It will be looked at, but we have close to 900 proposed or active bugs at this time, out of which more than 160 have more votes. This is an open source project, that depends on people like you and me contributing patches. This can take time (a lot of time in some cases). In other words, we have a lot on our hands.

If you need a bug fixed urgently, you can do three things:

* convince a regular contributor that this bug is more important or blocking than the other 900. This will be the case for example if it's a serious regression affecting a lot of people, if it's a security issue, or if it's causing irreversible data damage.

* fix it yourself

* find someone who would be willing to fix it, maybe for a fee

I hope this helps.

Jan 27, 2013 at 8:42 PM

doesn't really help ... guess I'll have to go back to 1.4 ... but seriously ... what is the qa process  ??  I don't understand why a broken feature that was working in an earlier release isn't caught by  tdd ... seems like some process improvement is in order ... Disqus is not a part of your test harness ??

"we have close to 900 proposed or active bugs at this time" - seems to me that backward compatibility bugs deserve to be at the top of the list ... and I didn't "file the bug" ... it was reported in December ...

My bad for not checking before I upgraded ... but the Orchard team won my confidence so I didn't think I was taking a risk by investing in the upgrade ...

What's the best case for getting this fixed ??   Seems like the problem should be pretty easy to detect since it works with Web Matrix

I've migrated to the new menuing features ( nice job ) ... but do have a backup of my 1.4 solution.

OP's who have reported this problem ... Pls let the team that this fix deserves priority ....

Steve 

Coordinator
Jan 27, 2013 at 9:39 PM

No, Disqus is not part of our test harness. There are almost 500 different modules on the gallery. We can't test them all.

I understand that this bug is important to you, but the other bugs are all also important to someone. Some of the other bugs are regressions as well. We don't have a full-time QA team (or a full-time team at all), so we need to rely on people donating part of their time to improve Orchard. We do triage publicly during the podcast recording every Tuesday at 12:00PM Pacific Time on http://orchardproject.net/meeting. You are more than welcome to come to the meeting and defend your bug.

All constructive suggestions and contributions are welcome as always, including on process.

Nick tried to reproduce the problem and was unable to. He also offered to help and collaborate with you in reproducing. I think you should accept that offer. Just saying...

Jan 28, 2013 at 1:08 AM

wait ... from this thread it seems as if the bug is not yet resolved ... not sure what it means that "nick was unable" ... are you saying that he get Disqus to run under Orchard 1.6 using IIS ? 

I'm looking for a message from Nick here or on Codeplex  ....

I do want to contribute but I'm rather specialized on back-end and middle tier - and web services ... most recently WEB API stuff with MVC 4.Web API ...

Maybe I could get involved with some TDD / QA tasks ... who is heading that up ?

Please let me know of others have been sucessful with Orchard 1.6 / IIS and Disqus -- also have a SQL repository .... 

Good luck with the other prority stuff.

Steve

 

 

Coordinator
Jan 28, 2013 at 3:31 AM

Nick should answer this one, yes. By the way, is this the module you're using? http://onestopdisqus.codeplex.com/

Jan 29, 2013 at 5:37 AM

yes tried the oneStop version ... no help ... it did not indicate that it is V 1.0 ... still v .9 ....

Frustrating thing is that Disqus runs using the same directory where my IIS Site is installed  using Web Matrix ( tho the Disqus icon does not appear in the  aside left panel on Dashboard -- so can't configure it --- but it works ... posts comments using Disqus UI on my orchard blogs .. and forwards those posts to Disqus using the Twitter, Facebook, G+, and basic email sign on protocols.  But does not work on IIS ...

a 1.4 orchard site with  Disqus installed shows the "gear" icon in the aside left panel - in no case ... IIS or Web Matrix does it appear in 1.6

I will move the same Orchard and SQL backupa to another Windows Server to see if that may make a difference  

On IIS all kinds of wierd things happen .... Module gallery tells me I have to upgrade to newer version of Disqus ... have to wait a long time until the hyperlinks to display in browser and after I re-install it still tells me that I need to upgrade .... ( but I did experiment with the oneStop version too )

Still my ? is ... has anyone gotten Disqus to work on IIS 7 with a Orchard 1.6 site ???

From the metrics on the Orchard Disqus site there are a significant number of Disqus downloads / installs ... but there are not many problem reports ??

More later ..

Steve

Coordinator
Jan 31, 2013 at 5:28 AM
To answer one of your questions, yes, Onestop as far as I know is running their own Disqus module on some of their sites, and they are on IIS, on 1.x (which is more recent than 1.6). Was anyone else able to reproduce your issue on 1.x? Also, I'm still a bit confused about how IIS has anything to do with this, as the command-line runs without a web server and independently from it. Can you explain what you mean when you say it works with WebMatrix but not IIS? Are we still talking about the command-line?
Jan 31, 2013 at 5:38 AM
I don't use the command line ...
<div><br> </div> <div>I run it from IIS and go into Admin mode to create my solution ... only make minor mods to the .cshtml views to customize ... make a few CSS and Javascript modifications.</div> <div><br> </div> <div>And yes ... When I run the solution on IIS the Orchard Comments Module pops up right away when attempting to add a comment to a blog post ...</div> <div><br> </div> <div>When I run it in web matrix ... using the same solution ... Disqus works fine ... seems significant that when I run it on IIS Orchard Comments pop up immediately ... when running on Web Matrix there is a slight latency before Disqus shows up.</div> <div><br> </div> <div>/s </div> <div><br> </div> <div><br> <br> <div>On Thu, Jan 31, 2013 at 1:28 AM, bertrandleroy <span dir="ltr">&lt;<a href="mailto:notifications@codeplex.com" target="_blank">notifications@codeplex.com</a>&gt;</span> wrote:<br> <blockquote style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex"> <div> <p>From: bertrandleroy</p> <div>To answer one of your questions, yes, Onestop as far as I know is running their own Disqus module on some of their sites, and they are on IIS, on 1.x (which is more recent than 1.6). Was anyone else able to reproduce your issue on 1.x? Also, I'm still a bit confused about how IIS has anything to do with this, as the command-line runs without a web server and independently from it. Can you explain what you mean when you say it works with WebMatrix but not IIS? Are we still talking about the command-line?</div> <div> <div> <p>Read the <a href="http://orchard.codeplex.com/discussions/405905#post994522" target="_blank"> full discussion online</a>.</p> <p>To add a post to this discussion, reply to this email (<a href="mailto:orchard@discussions.codeplex.com?subject=[orchard:405905]" target="_blank">orchard@discussions.codeplex.com</a>)</p> <p>To start a new discussion for this project, email <a href="mailto:orchard@discussions.codeplex.com" target="_blank"> orchard@discussions.codeplex.com</a></p> <p>You are receiving this email because you subscribed to this discussion on CodePlex. You can <a href="https://orchard.codeplex.com/discussions/405905/unsubscribe/" target="_blank"> unsubscribe</a> on CodePlex.com.</p> <p>Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com</p> </div> </div> </div> </blockquote> </div> <br> </div>
Coordinator
Jan 31, 2013 at 5:40 AM
That clears some confusion, thanks.
Mar 12, 2013 at 10:21 PM
I got the same error. My process for having found it was a little different.

I was working on the Nwazet module, adding a customer controller (model, driver, etc). I went to disable the Nwazet.Commerce feature and re-enable (thinking it would re-rerun the migration). It also disabled a couple of other features that were dependent on it. The enable link didn't show up upon disabling the feature.

I tried enabling it via the command-line. I got the following error and stack trace:
Stack Trace:

[InvalidOperationException: Sequence contains no matching element]
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at Orchard.Environment.Features.FeatureManager.<>c__DisplayClass2d.<EnableFeature>b__20(String fId) in C:\Business\De
velopment\Clients\EricaZap\Orchard.Source.1.6\src\Orchard\Environment\Features\FeatureManager.cs:line 148
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elemen
tSelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elemen
tSelector)
   at Orchard.Environment.Features.FeatureManager.<EnableFeature>b__1e(String currentFeatureId, IDictionary`2 featuresSt
ate) in C:\Business\Development\Clients\EricaZap\Orchard.Source.1.6\src\Orchard\Environment\Features\FeatureManager.cs:l
ine 147
   at Orchard.Environment.Features.FeatureManager.GetAffectedFeatures(String featureId, IDictionary`2 features, Func`3 g
etAffectedDependencies) in C:\Business\Development\Clients\EricaZap\Orchard.Source.1.6\src\Orchard\Environment\Features\
FeatureManager.cs:line 195
   at Orchard.Environment.Features.FeatureManager.EnableFeature(String featureId, IDictionary`2 availableFeatures, Boole
an force) in C:\Business\Development\Clients\EricaZap\Orchard.Source.1.6\src\Orchard\Environment\Features\FeatureManager
.cs:line 153
   at Orchard.Environment.Features.FeatureManager.<>c__DisplayClass9.<EnableFeatures>b__4(String featureId) in C:\Busine
ss\Development\Clients\EricaZap\Orchard.Source.1.6\src\Orchard\Environment\Features\FeatureManager.cs:line 73
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Orchard.Environment.Features.FeatureManager.EnableFeatures(IEnumerable`1 featureIds, Boolean force) in C:\Business
\Development\Clients\EricaZap\Orchard.Source.1.6\src\Orchard\Environment\Features\FeatureManager.cs:line 72
   at Orchard.Modules.Services.ModuleService.EnableFeatures(IEnumerable`1 featureIds, Boolean force)
   at Orchard.Modules.Commands.FeatureCommands.Enable(String[] featureNames)
Any ideas?
Coordinator
Mar 12, 2013 at 10:38 PM
Disabling and re-enabling a feature is not going to re-run migrations. Why did you need to re-run them in the first place? Because of your custom development? I would restart from scratch, your instance seems to be in an inconsistent state now.
Mar 14, 2013 at 5:37 PM
That kinda sucks, but it is what it is. :-)

Yes, I needed to re-run the migrations because of my custom code. I thought I had read in a blog somewhere that disabling and re-enabling a feature would re-run migrations. I guess that was wrong. So what does? Simply recompiling the project and refreshing?

Do I really have to start from scratch (meaning downloading Nwazet and re-coding my stuff)? Or can I just delete that database in App_Data?
Coordinator
Mar 14, 2013 at 5:43 PM
One thing you can do is go into the database and alter Orchard_Framework_DataMigrationRecord. It may not work however because your database schema has probably changed last time you ran your migration, and that's not what your new migration is expecting. So unless you're sure that it's safe, I would either re-start from scratch (a good practice as your users will be in that exact situation), and you can use a custom setup recipe to speed things up, or I would add a new migration step instead, and keep the Create method updated to point to the latest state, to make things faster for new users of the module (the create method can very well aggregate lots of steps and return something else than 1.
Mar 15, 2013 at 1:43 AM
Ok...so here is an interesting development. In the Module.txt, if I get rid of the Orchard.Projections dependency, then the Enable shows up and I can enable Nwazet.Commerce and all is well. Huh?
Coordinator
Mar 15, 2013 at 1:56 AM
Look for circular dependencies.