How can I debug odoo 9 in eclipse? [Linux] - eclipse

I have eclipse Neon in Linux Ubuntu 16.04
When I run a odoo server, it works everything fine in port 8069
But, when I debug the same odoo server, (now, the port is 8072) it appears to freeze in a infinite loop. In the browser doesn't appear anything (Waiting for localhost...), and the log shows this:
...
25138 INFO mydb openerp.modules.loading: 81 modules loaded in 0.73s, 0 queries
25138 INFO mydb openerp.modules.loading: Modules loaded.
25138 INFO mydb openerp.addons.base.ir.ir_http: Generating routing map
192.168.1.31 - - [2016-09-12 12:14:51] "GET / HTTP/1.1" 200 24082 21.358104
25138 INFO mydb openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
This is my odoo9-server.conf (renamed openerp-server.conf):
[options]
admin_passwd = myAdminPass
db_host = False
db_port = False
db_user = myUserName
db_password = myDatabasePass
addons_path = /etc/odoo/server/addons,/etc/odoo/server/addons_extra
logfile = None
xmlrpc_port = 8069
log_level = debug
Is there something wrong?

To debug your odoo+python code in eclipse, start eclipse in debug perspective and follow the given steps:
1: Stop your Odoo running server by pressing "ctr+c".
2: In eclipse go to Menu "Run/Debug Configurations". In configuration window under "Python Run", create new debug configuration(Double click on 'Python Run').
3: After creating new debug configuration follow the given steps:
3.1: In "Main" tab under "Project", select the "server" project or folder (in which Odoo Server resides) from your workspace.
3.2: Write location of 'openerp-server' or 'odoo.py' under "Main Module".
Ex: ${workspace_loc:odoo/openerp-server}.
3.3: In "Arguments" tab under "Program Arguments", click on button "Variables" and new window will appear.
3.4: Then create new "Variable" by clicking on "Edit Variables" button and new window will appear.
3.5: Press on "New" button and give your addons path as value.
Ex: --addons ../addons,../your_module_path
3.6: Press Ok in all the opened windows and then "Apply".
4: Now into "PyDev Package Explorer" view go to odoo and right click on "openerp-server" or odoo.py file, Select 'Debug As --> Python Run'.
5: Now in "Console" you can see your server has been started.
6: Now open your .py file which you want to debug and set a break-point.
7: Now start your module's form from 'gtk' or 'web-client' and execution will stop when execution will reach to break-point.
8: Now enjoy by debugging your code by pressing "F5, F6, F7" and you can see value of your variables.
Source: https://stackoverflow.com/a/12298831/1312904

To invoke pdb, add this line
import pdb; pdb.set_trace() anywhere you want to set a breakpoint
and then start your odoo with the --debug flag set, something along the lines of
./odoo.py --addons=addons,myaddons --debug
and then when you execute an action on the server that hits the point where you invoked pdb, the execution will immediately stop and you'll have a pdb prompt that you can use to debug

Finally I got the solution.
In the Debug Configurations, I changed the content of Main Module and I wrote this:
${workspace_loc:my_project/openerp-gevent}
The important part is the openerp-gevent
Now, the debug works fine

Related

How to minimize Eclipse PyDev Console output / tracing

I have multiple installations of Eclipse(2021-12) + PyDev(9.3.0.202203051235) all using Iron Python(2.7). All running on Windows 10. They all run the scripts as expected, but one installation has a much more robust console output when debugging, almost like a tracing option is enabled. I've tried reinstalling, deleting workspaces, deleting '.metadata' folders, etc. All the project settings seem identical.
Any ideas how to minimize the console output? Something in registry?
Expected Console output:
pydev debugger: starting (pid: 15312)
Actual Console output:
1.99s - Using GEVENT_SUPPORT: False
0.00s - Using GEVENT_SHOW_PAUSED_GREENLETS: False
0.00s - pydevd __file__: C:\\Eclipse-2021-12-R\plugins\org.python.pydev.core_9.3.0.202203051235\pysrc\pydevd.py
0.11s - Initial arguments: (['C:\\Eclipse-2021-12-R\\plugins\\org.python.pydev.core_9.3.0.202203051235\\pysrc\\pydevd.py', '--multiprocess', '--protocol-http', '--print-in-debugger-startup', '--vm_type', 'python', '--client', '127.0.0.1', '--port', '60413', '--file', 'C:\\Test.py'],)
0.00s - Current pid: 8884
pydev debugger: starting (pid: 8884)
Those should only appear if you add an environment variable asking it to be shown.
i.e.: Something as:
PYDEVD_DEBUG=1
PYDEV_DEBUG=1
Maybe you have such an environment set in your launch configuration or interpreter configuration or elsewhere in your system?
You may want to check the os.environ of the running program to see what's set there.

VS Code ssh; server install path

I am trying to change the VS Code server folder install location. The functionality was recently implemented and I've found the following references [1], [2].
However, I have not been able to implement it myself and in trying I get the following error message:
C:\\Users\\username/.ssh/config: line 1: Bad configuration option: remote.ssh.serverinstallpath
C:\\Users\\username/.ssh/config: terminating, 1 bad configuration options
The config file is constructed in the following way
"remote.SSH.serverInstallPath": {"hostname": "/test/location"}
Host hostname
HostName hostname
User username
NOTE: I have obscured the connection as 'hostname' and the user as 'username'
This config is for vscode's settings.json file (not .ssh/config):
e.g on Windows, do Ctrl+Shift+P > "Preferences: Open User Settings (JSON)". Then, you can add the following lines at the end.
"remote.SSH.serverInstallPath": {
"<host>": "/test/location"
}
Alternative, if you want do it via settings UI:
File > Preferences > Settings
Filter: #ext:ms-vscode-remote.remote-ssh install
Under "Server Install Path" > Add Item
Item = <host>
Value = /test/location

How to run 2 commands in same line in SROS?

How to run 2 commands in same line in SROS? I have tried
command1 & command2
command1 && command2
command1 | command2
command1 || command2
command1; command2
(command1 &) & (command2 &)
(command1; command2) &
(command1 &) && (command2 &)
I'm not sure that's possible, at least not with the version(s) I'm currently running. Depending on your requirements you can load your commands into a configuration file and execute it from CLI as a single entry. For example if you wanted to show the FDB of two VPLSs in a single operation you could add those show commands to a file called show.cfg on CF3 and then execute it with exec cf3:\show.cfg.
A:7705-299# file type cf3:\show.cfg
File: show.cfg
-------------------------------------------------------------------------------
show service id 7299 fdb detail
show service id 13002297 fdb detail
===============================================================================
A:7705-299# exec cf3:\show.cfg
===============================================================================
Forwarding Database, Service 7299
===============================================================================
ServId MAC Source-Identifier Type Last Change
Age
-------------------------------------------------------------------------------
7299 01:0b:20:0b:ca:d7 sap:1/1/10 L/44 03/29/20 11:23:34
7299 30:c8:98:c6:b5:47 sdp:11:7299 L/456 01/16/20 15:02:17
-------------------------------------------------------------------------------
No. of MAC Entries: 2
-------------------------------------------------------------------------------
Legend: L=Learned O=Oam P=Protected-MAC C=Conditional S=Static
===============================================================================
===============================================================================
Forwarding Database, Service 13002297
===============================================================================
ServId MAC Source-Identifier Type Last Change
Age
-------------------------------------------------------------------------------
13002297 0a:b0:02:cf:5a:f0 sap:1/1/7:200 L/117 04/09/20 11:11:20
13002297 11:a2:a8:c6:b5:47 sdp:11:13002297 L/396 02/13/20 11:13:11
13002297 3d:d0:4b:25:5c:fc sap:1/1/12 L/44 04/21/20 00:59:03
-------------------------------------------------------------------------------
No. of MAC Entries: 3
-------------------------------------------------------------------------------
Legend: L=Learned O=Oam P=Protected-MAC C=Conditional S=Static
===============================================================================
Executed 2 lines in 0.8 seconds from file cf3:\show.cfg
I also don't think it is possible to send two commands in a single line. However, I have an another workaround for you if you are using SecureCRT.
In SecureCRT, there is an option to send multiple commands in one click. I have used to send following commands in one click, please see following:
environment no more
show version
show chassis
To do this, I have opened "Button Bar" under "View" section first:
Then, it gives me a button as following:
When you right click the green button, and click on edit, you will receive following screen. You can type any command as following, and you can also change the button color.
So that you can run multiple commands in one click.

EasyPHP Webserver - Dashboard - http://127.0.0.1:10000 No longer loading

I am running EasyPHP Webserver 14.1 on Win Server 2012.
When I first installed it the dashboard loaded fine.
Now that I have built up my PHPbb3 forum it no longer loads. The browser continuously states
Waiting for response from 172.0.0.1...
but nothing happens, it just keeps spinning trying to load.
Is there any way I can fix /restore / reinstall the dashboard without affecting any work I've done on PHPbb3?
If it helps after some searching on this forum I created a .bat file containing:
ews-dashboard.exe -S 127.0.0.1:10000 -c ews-dashboard.ini cmd /k
This opens a CMD window containing the following:
C:\Program Files (x86)\EasyPHP-Webserver-14.1b2\dashboard>ews-dashboard.exe -S 127.0.0.1:10000 -c ews-dashboard.ini
PHP 5.4.30 Development Server started at Tue Nov 14 14:33:33 2017
Listening on http://127.0.0.1:10000
Document root is C:\Program Files (x86)\EasyPHP-Webserver-14.1b2\dashboard
Press Ctrl-C to quit.
But this doesn't seem to change anything.
it will work if you change the current port.
start-ews.bat
ews-dashboard.exe -S 127.0.0.1:1000 -c ews-dashboard.ini cmd /k
ews-dashboard.ini
[ServiceEx]
ServiceExeFullPath = "D:/Program Files/EasyPHP-Webserver\dashboard\ews-dashboard.exe"
; program arguments to be sent to executable
options = "-S 127.0.0.1:1000"
; can program interact with desktop [true | false] (default: true)
desktop = false
; start type (valid values: Auto Manual Disabled) (default: auto)
Start=Auto
; start the service upon installation [true | false] (default: no)
StartNow=true

xdebug in xampp doesn't work on netbeans

I try to config xdebug but doesn't work I use:
XAMPP 1.7.4 , Netbeans 7.0
Xdebug installed: 2.1.0rc1
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC6 - Architecture: x86
Zend Server: no
PHP Version: 5.3.5
Zend API nr: 220090626
PHP API nr: 20090626
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\WINDOWS
Configuration File: C:\xampp\php\php.ini
Extensions directory: C:\xampp\php\ext
And php.ini:
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.collect_includes = 1
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.default_enable = 1
xdebug.extended_info = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = "DBGp"
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000
Now the problems:
Menu attach Debugger is still disabled or grayed out.
When I try to debug the break point is never hit. Scripts run like a normal.
Following is the URL of I get when I click Debug main project:
http://localhost/index.php?XDEBUG_SESSION_START=netbeans-xdebug
When I close the browser debugger does not stop. It shows the waiting for connection status.
When I click the stop debugging button in NetBeans gives a messagebox There is no connection from xdebug detected with in some seconds xdebug is not configured or xdebug is not installed.
Please guide me to resolve the above mentioned issues and debug the project.
First are you able to see xdebug in http://localhost/xampp/index.php ? If NOT then probably you are NOT editing the right php.ini file? Seems like XAMPP is using the php.ini file in:
c:\xampp\apache\bin\php.ini
Enter your configuration for xdebug in that file, restart Apache and you should be able to connect.
There was no need for me to change anything in Netbeans to get it to work.
Screenshots here: http://rudyegenias.wordpress.com/2011/07/03/xampp-xdebug-xdebug-not-showing-in-phpinfo/
? to use XDebug on Netbeans & XAMPP
use http://xdebug.org/wizard.php to inspect your system and download best xdebug.dll
place that .dll in C:/xampp/php/ext
edit C:/xampp/php/php.ini adding following
[XDebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.2.3-5.5-vc11.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.show_local_vars=on
xdebug.output_buffering=off
restart Apache web server
I've struggled with a lot of other setting but this is best to do the job