v6 WINDOWS errors + corrections

Bug #649595 reported by GEM
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Hi,
to build and install allinone for windows, I must make this changes and it's work :

in server\setup.py
line176 change :
"imaplib", "smtplib", "email", "yaml", "DAV",
by
"imaplib", "smtplib", "email", "yaml", "DAV", "simplejson"

in server\bin\openerp-server.py line 38 change :
import pwd
by :
#import pwd

line 50 change :
if pwd.getpwuid(os.getuid())[0] == 'root' :
    sys.stderr.write("Attempted to run OpenERP server as root. This is not good, aborting.\n")
    sys.exit(1)
by
if not sys.platform == 'win32':
    import pwd
    if pwd.getpwuid(os.getuid())[0] == 'root' :
        sys.stderr.write("Attempted to run OpenERP server as root. This is not good, aborting.\n")
        sys.exit(1)

server\bin\tools\config.py :

lines 49-50 put :
'db_host': '127.0.0.1',
'db_port': 5432,
lines 52-53 put :
'db_user': 'openpg',
'db_password': 'openpgpwd',

*********************************************************************************
Does the working directory for windows in not the same as linux ?

server\bin\addons\__init__.py line 50 :
change :
_ad = os.path.abspath(opj(tools.config['root_path'], 'addons'))
by
_ad = os.path.abspath(opj(tools.config['root_path'], opj(tools.config['addons_path'])))

server\bin\addons\base\res\res_compagny.py line 199 :
change :
-tools.config['root_path'], '..', 'pixmaps', 'openerp-header.png')
+tools.config['root_path'], 'pixmaps', 'openerp-header.png'):

line 308, change :
self.options['addons_path'] = os.path.join(self.options['root_path'], 'addons')
by
self.options['addons_path'] = os.path.join(self.options['root_path'], os.path.join('bin', 'addons'))

Hope this will help.
Bye

Revision history for this message
xrg (xrg) wrote : Re: [Bug 649595] [NEW] v6 WINDOWS errors + corrections

On Tuesday 28 September 2010, you wrote:
> Public bug reported:
>
> Hi,
> to build and install allinone for windows, I must make this changes and
> it's work :
>
>
> in server\bin\openerp-server.py line 38 change :
> import pwd
> by :
> #import pwd
>
> line 50 change :
> if pwd.getpwuid(os.getuid())[0] == 'root' :
> sys.stderr.write("Attempted to run OpenERP server as root. This is not
> good, aborting.\n") sys.exit(1)
> by
> if not sys.platform == 'win32':
> import pwd
> if pwd.getpwuid(os.getuid())[0] == 'root' :
> sys.stderr.write("Attempted to run OpenERP server as root. This is
> not good, aborting.\n") sys.exit(1)

The test is there for some reason. You shall NOT run the server as root, and I
believe the same should apply to win32.

>
> server\bin\tools\config.py :
>
> lines 49-50 put :
> 'db_host': '127.0.0.1',
> 'db_port': 5432,
> lines 52-53 put :
> 'db_user': 'openpg',
> 'db_password': 'openpgpwd',

No, the defaults are there on purpose. Please override them with a config file,
don't ask us to have your settings as default. Setting a value at db_host,
db_port will break the default unix connection to Postgres.

> server\bin\addons\__init__.py line 50 :
> change :
> _ad = os.path.abspath(opj(tools.config['root_path'], 'addons'))
> by
> _ad = os.path.abspath(opj(tools.config['root_path'],
> opj(tools.config['addons_path'])))
> server\bin\addons\base\res\res_compagny.py line 199 :
> change :
> -tools.config['root_path'], '..', 'pixmaps', 'openerp-header.png')
> +tools.config['root_path'], 'pixmaps', 'openerp-header.png'):
> line 308, change :
> self.options['addons_path'] = os.path.join(self.options['root_path'],
> 'addons') by
> self.options['addons_path'] = os.path.join(self.options['root_path'],
> os.path.join('bin', 'addons'))

These break the current paths logic.

Revision history for this message
GEM (nimp3) wrote :

Hi xrg,

module pwd doesn't work with win32 platform, just unix.
I believe to remember me that to install openerp on windows, user should just have administrator rights, but for user Administrator, I don't know (but it is hidden and must be activated manually, then know well windows) but ask to Stephane Wirtel to confirm that.

for options db I understand, but to build and have allinone for windows running after installation, this is the default values, which can find in setup.nsi corresponding to the allinone, line 168 (db_port, db_user and db_password).
for allinone a config file is automatically created during installation of setup, with values of lines 49-50 and lines 52-53 (don't forget that allinone should not have to be configured to run).
perhaps add this in win32\setup.py.

for the path I'm agree with you, but for windows, the path given for root_path is server (without change), and addons_path addons(without_change, in the conf file generated I have addons_path = C:\OpenERP AllInOne\Server\addons) .
The problem is that actually when I build server, addons are in server\bin\addons after installation.

with windows, tools.config['root_path'], '..', 'pixmaps', 'openerp-header.png') doesn't work with server\addons or server\bin\addons

At least i find bugs and corrected for windows
I you have a solution which works, for all platform, thanks :)
Bye

Revision history for this message
GEM (nimp3) wrote :

HI,
just add the fact that simplejson should be add to the list of required modules, even for linux :

addons\marketing_campaign_mailchimp\marketing_campaign_mailchimp.py (1 hits)
 Line 23: import simplejson as json

as I wrote :

in server\setup.py
line176 change :
"imaplib", "smtplib", "email", "yaml", "DAV",
by
"imaplib", "smtplib", "email", "yaml", "DAV", "simplejson"

Bye

Revision history for this message
GEM (nimp3) wrote :

Hi, @xrg,
for info no need to change :

server\bin\tools\config.py :

lines 49-50 put :
'db_host': '127.0.0.1',
'db_port': 5432,
lines 52-53 put :
'db_user': 'openpg',
'db_password': 'openpgpwd',

that works with original code self.option

Bye

Revision history for this message
GEM (nimp3) wrote :

Hi,
bug can be closed
corrected by Stephane Wirtel.
Bye

Changed in openobject-server:
status: New → Fix Released
milestone: none → 6.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.