This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 239750 - Symfony2 commands no longer runs from Netbeans 7.4
Summary: Symfony2 commands no longer runs from Netbeans 7.4
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Symfony (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 249531 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-24 03:03 UTC by myknbani
Modified: 2015-01-19 08:33 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Error in Netbeans (51.38 KB, image/png)
2013-12-24 03:03 UTC, myknbani
Details
Sample project (9.39 MB, application/zip)
2014-01-03 11:28 UTC, myknbani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description myknbani 2013-12-24 03:03:13 UTC
Created attachment 143416 [details]
Error in Netbeans

Symfony2 commands no longer work.  It appears to be requiring all command-line options to be filled-up.

Example:  generate:bundle --namespace="Foxtech/TrollBundle"

-------
"/opt/lampp/bin/php" "/opt/lampp/htdocs/symfonytest/app/console" "--ansi" "generate:bundle" "--namespace=Foxtech/TrollBundle"
                                   
  [RuntimeException]                  
  The "dir" option must be provided.  
-------

It used to ask bundle names, etc. interactively, if I remember correctly.

As it stands right now, the work around is to input commands from an external console (e.g. php app/console generate:bundle), which works perfectly.

I also tried pasting the command generated by Netbeans in the console, and it also works.

-------
"/opt/lampp/bin/php" "/opt/lampp/htdocs/symfonytest/app/console" "--ansi" "generate:bundle"

                                            
  Welcome to the Symfony2 bundle generator  ........
                                            
-------

Environment:
Netbeans 7.4 64-bit
PHP 5.4.22
Symfony 2.4
Java (Oracle):  1.7.0_40

I attached a screenshot here.
Comment 1 Tomas Mysik 2014-01-02 09:57:27 UTC
It works for me without any problem in the current development version. Can you please test it?

Thanks.

Product Version: NetBeans IDE Dev (Build 20140102-e2bbf65912ea)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.11.0-14-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 2 myknbani 2014-01-03 06:52:32 UTC
I can't test the development version right now, since the download link is going 404.

http://bits.netbeans.org/download/trunk/nightly/latest/bundles/netbeans-trunk-nightly-201401020002-linux.sh

I'll do give it a try when the download is fixed.  Thanks ^_^
Comment 3 Tomas Mysik 2014-01-03 06:54:26 UTC
You can use our PHP build [1] (download the "NetBeans-dev-*-php.zip" file).

Thanks!
[1] http://deadlock.netbeans.org/job/PHP-build/
Comment 4 myknbani 2014-01-03 10:48:41 UTC
did not work for me...

Product Version: NetBeans IDE Dev (Build 201401030002)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.11.0-14-generic running on amd64; UTF-8; en_US (nb)
User directory: /home/mykee/.netbeans/dev
Cache directory: /home/mykee/.cache/netbeans/dev

"/opt/lampp/bin/php" "/opt/lampp/htdocs/sftesto/app/console" "--ansi" "generate:bundle"


                                            
  [RuntimeException]                        
  The "namespace" option must be provided.  
                                            


generate:bundle [--namespace="..."] [--dir="..."] [--bundle-name="..."] [--format="..."] [--structure]


Done.
Comment 5 Tomas Mysik 2014-01-03 11:03:13 UTC
Weird... It seems like your Symfony commands are not interactive - is there a way to configure it? Could you please attach a sample project I can use to reproduce your problem? Or at least provide _exact_ steps I need to do to reproduce your problem?

Simply reopen this issue, thanks.
Comment 6 myknbani 2014-01-03 11:28:26 UTC
Created attachment 143578 [details]
Sample project
Comment 7 myknbani 2014-01-03 11:32:22 UTC
The steps:

1.  Create a fresh Symfony2 project, you can name it anything, PHP version at 5.4
2.  Right-click the project -> Symfony2 -> Run Command -> generate:bundle

"/opt/lampp/bin/php" "/opt/lampp/htdocs/testproj/app/console" "--ansi" "generate:bundle"


                                            
  [RuntimeException]                        
  The "namespace" option must be provided.  
                                            


generate:bundle [--namespace="..."] [--dir="..."] [--bundle-name="..."] [--format="..."] [--structure]


Done.

----------

I'll attach a sample project as well...
Comment 8 myknbani 2014-01-03 11:51:19 UTC
just to recap, it works via command-line, same project:

mykee@shinratensei-lappy:~ > cd /opt/lampp/htdocs/testproj/
mykee@shinratensei-lappy:/opt/lampp/htdocs/testproj > php app/console generate:bundle

                                            
  Welcome to the Symfony2 bundle generator  
                                            


Your application code must be written in bundles. This command helps
you generate them easily.

---------

a copy-paste of the Netbeans generated command also makes it interactive.. I don't know of any configuration that could cause this to be non-interactive...

"/opt/lampp/bin/php" "/opt/lampp/htdocs/testproj/app/console" "--ansi" "generate:bundle"                                                                                     
                                                                                                                    
                                                                                                                    
  Welcome to the Symfony2 bundle generator                                                                          
                                                                                                                    
                                                                                                                    
                                                                                                                    
Your application code must be written in bundles. This command helps
Comment 9 Tomas Mysik 2014-01-03 13:02:44 UTC
Well, the likely cause is a "bug" in Symfony - my project uses Symfony 2.0.4 but your project has 2.4.0. Perhaps newer Symfony somehow detects interactive shell - this detection works in shell but fails in NetBeans. Not sure whether this can be fixed on NetBeans' side since Symfony has only "--no-interaction" option but no way to force interactive mode (e.g. "--interaction" option)... :/

IMHO you should submit a bug against Symfony project. I will try to investigate this issue more but as I wrote, not sure we can do anything with it in NetBeans, sorry.

Thanks.
Comment 10 Tomas Mysik 2014-01-03 13:03:43 UTC
As a workaround, you can specify all the required parameters in the Run Command window but I understand that this is not user friendly...
Comment 11 Tomas Mysik 2014-01-03 13:29:12 UTC
I found it I think, in Symfony/Component/Console/Application.php, line 840:

        } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) {
            $inputStream = $this->getHelperSet()->get('dialog')->getInputStream();
            if (!@posix_isatty($inputStream)) {
                $input->setInteractive(false);
            }
        }

IMHO this cannot be fixed in NetBeans, sorry (please note that one can click in the output window, there is a caret there). Please, submit a bug against Symfony and let us know if there is anything needed in NetBeans then. I can imagine that if an env variable (e.g. "INTERACTIVE=true") is set, the interactive shell will be forced. Or, of course, a new option could be added but in such case, it would be kind of backward compatibility break since NetBeans would not work with older Symfony versions (with the env variable, this problem would not occur).

Let me know if you are NOT going to submit an issue against Symfony, I will do it.

Thanks.
Comment 12 myknbani 2014-01-03 13:50:19 UTC
Thanks Tomas!

I think it would be better if you submit the bug report.  You as the maintainer can explain the issue better.  ^_^
Comment 13 Tomas Mysik 2014-01-06 06:56:38 UTC
Done, see [1]. Feel free to vote for it :)

BTW as a workaround, you can comment line 843 in your Symfony/Component/Console/Application.php, it should work. Of course, you would need to repeat this step once you upgrade/install your Symfony files into your project again.

Thanks for reporting.
[1] https://github.com/symfony/symfony/issues/9946
Comment 14 myknbani 2014-01-06 07:03:12 UTC
Thanks!  As an added note, Netbeans 7.4 in Windows works, and does not need the workaround.
Comment 15 Tomas Mysik 2014-01-06 07:10:08 UTC
Great to hear, apparently the detection in Symfony is not perfect :) Feel free to update the reported Github issue.

Thanks.
Comment 16 Tomas Mysik 2014-01-06 10:05:43 UTC
@jhavlin: Jardo, could this issue be fixed in the Output window or not? Feedback from Symfony [1] is:

> it seems more like a bug in netbeans to me. Is there really nothing can be done
> in netbeans to make it presents its shell as an interactive one?

Thanks a lot.
[1] https://github.com/symfony/symfony/issues/9946
Comment 17 Jaroslav Havlin 2014-01-06 15:18:27 UTC
> @jhavlin: Jardo, could this issue be fixed in the Output window or not?
I'm sorry, this cannot be fixed in Output Window. The processes would have to be executed in some pseudo-terminal, which seems quite complicated. Moreover, I'm not sure that Output Window should pretend to be a terminal if it is not a terminal.
Comment 18 Tomas Mysik 2014-01-07 09:09:00 UTC
@jhavlin: Thanks a lot Jardo, I have updated the Github issue.
Comment 19 Tomas Mysik 2014-03-27 06:48:45 UTC
Reopening, I will add an ENV property to NetBeans. The rest will be on Symfony guys, we cannot do more, sorry.

Thanks.
Comment 20 Tomas Mysik 2014-04-17 06:46:18 UTC
Fixed. Láďo, please verify (just print_r($_SERVER) somewhere in Symfony/Component/Console/Application.php) and you should find "SHELL_INTERACTIVE" environment variable set to "true".

Thanks!

http://hg.netbeans.org/web-main/rev/641a1c7c5b60
Comment 21 Tomas Mysik 2014-04-17 06:51:11 UTC
I have updated the related Github issue [1] as well.

Thanks.
[1] https://github.com/symfony/symfony/issues/9946
Comment 22 Tomas Mysik 2014-04-17 06:55:28 UTC
BTW just to be clear - the change done in NetBeans is unfortunately not enough, Symfony itself must be improved as well.
Comment 23 Quality Engineering 2014-04-18 02:41:36 UTC
Integrated into 'main-silver', will be available in build *201404180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/641a1c7c5b60
User: Tomas Mysik <tmysik@netbeans.org>
Log: #239750 - Symfony2 commands no longer runs from Netbeans 7.4
Comment 24 Vladimir Riha 2014-04-18 06:50:02 UTC
Verified

Product Version: NetBeans IDE Dev (Build 201404180001)
Java: 1.8.0; Java HotSpot(TM) Client VM 25.0-b70
Runtime: Java(TM) SE Runtime Environment 1.8.0-b132
System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
Comment 25 Tomas Mysik 2014-04-18 07:04:12 UTC
Transplanted to releases repo to the branch release80.

Thanks.

http://hg.netbeans.org/releases/rev/19f7476e72dc
http://hg.netbeans.org/releases/rev/5b346e618315
Comment 26 Quality Engineering 2014-04-24 02:05:53 UTC
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/19f7476e72dc
User: Tomas Mysik <tmysik@netbeans.org>
Log: #239750 - Symfony2 commands no longer runs from Netbeans 7.4
(transplanted from 641a1c7c5b60567745e65892b1c3d6e5b85e1578)
Comment 27 Vladimir Riha 2014-04-24 12:08:24 UTC
verified in patch1

Product Version: NetBeans IDE 8.0 (Build 201403101706)
Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 1
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
Comment 28 Tomas Mysik 2015-01-19 08:33:31 UTC
*** Bug 249531 has been marked as a duplicate of this bug. ***