Issues with Trac (installed with BitNami) - configuration

I'm facing some problems after installing Trac on my Windows 7 Ultimate 64bits using BitNami.
The Issues are:
Subversion Control
During the installation process, when the BitNami setup asks for the project repository directory, it only accept if you write a path that doesn't exist, otherwise you can't continue. So i got forced to point the path to "C:\Repositories\TRAC" (a new folder) instead of "C:\Repositories\DBG" (where the repository of the project that i was creating really are). So, after the installation, I've changed the trac.ini file at the key
[trac]
repository_dir = C:\Repositories\TRAC
repository_type = svn
to
[trac]
repository_dir = C:\Repositories\DBG
repository_type = svn
And now, when I login to the DBG project in Trac, it warns:
Warning: Can't synchronize with the
repository (The 'repository_dir' has
changed, a 'trac-admin resync'
operation is needed.). Look in the
Trac log for more information.
When I go to cmd the following happens:
C:\Users\Fernando>cd\
C:\>cd C:\Program Files\BitNami Trac Stack\trac\Scripts
C:\Program Files\BitNami Trac Stack\trac\Scripts>trac-admin resync
Welcome to trac-admin 0.11.6
Interactive Trac administration console.
Copyright (c) 2003-2009 Edgewall Software
Type: '?' or 'help' for help on commands.
Trac [C:\Program Files\BitNami Trac Stack\trac\Scripts\resync]> resync
Failed to open environment. [Errno 2] No such file or directory: 'C:\\Program Fi
les\\BitNami Trac Stack\\trac\\Scripts\\resync\\VERSION'
Traceback (most recent call last):
File "c:\program files\bitnami trac stack\trac\lib\site-packages\Trac-0.11.6-p
y2.5.egg\trac\admin\console.py", line 177, in env_open
self.__env = Environment(self.envname)
File "c:\program files\bitnami trac stack\trac\lib\site-packages\Trac-0.11.6-p
y2.5.egg\trac\env.py", line 209, in __init__
self.verify()
File "c:\program files\bitnami trac stack\trac\lib\site-packages\Trac-0.11.6-p
y2.5.egg\trac\env.py", line 277, in verify
fd = open(os.path.join(self.path, 'VERSION'), 'r')
IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\BitNami Trac S
tack\\trac\\Scripts\\resync\\VERSION'
C:\Program Files\BitNami Trac Stack\trac\Scripts>
What it should be?
2-Configuring Logo:
I can't find where to place my project logo to be shown in left-top corner!
at the header_logo key:
[header_logo]
alt = DBG
height = 50
link = http://localhost:801/trac/DBG
src = ITINT150.png
width = 150
i've placed the ITINT150.png file in the same folder as trac.ini for testing (obviously i wasn't going to leave it there), but trac doesn't find it, looking at the html code of the link tag generated, it points to: src="/trac/DBG/chrome/common/ITINT150.png", but where is this folder located, so i can place the image there?
Thanks in advance!

For the resync, the first argument to trac-admin is the trac environment directory. So run
trac-admin <path-to-trac-environment> resync
As of Trac 0.12, the above command changed to:
trac-admin <path-to-trac-environment> repository resync <repository-name or '*'>
For the logo, set the src to site/ITINT150.png, and put ITINT150.png into the <path-to-trac-environment>/htdocs directory.

I tried #retracile's solution but I received a "Command not found" message from trac-admin. This is what eventually worked for me:
trac-admin </path/to/trac/env> repository resync "*"
That last argument specifies the repository to resync and can be switched with the name of a specific repo (presumably with the quotes intact; I didn't try it) if you don't want to resync all repos. See here for details: http://trac.edgewall.org/wiki/TracAdmin

Related

Mercurial commit fails: "The system cannot find the file specified", but it is not really specified

I can't commit a single file by Mercurial. Here are different variants of the command:
The variant with --traceback
C:\Users\543829657\workspace\dev.appl.ib.cbl>hg commit --traceback "--message=Ad
ded a task Xml2Java for creation request/response files" --user "Petr Gangnus <petr.gangnus#moneta.cz>" -- application/build.gradle
transaction abort!
rollback completed
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 160, in _runcatch
File "mercurial\dispatch.pyo", line 885, in _dispatch
File "mercurial\dispatch.pyo", line 646, in runcommand
File "mercurial\extensions.pyo", line 168, in closure
File "hgext\color.pyo", line 521, in colorcmd
File "mercurial\dispatch.pyo", line 976, in _runcommand
File "mercurial\dispatch.pyo", line 947, in checkargs
File "mercurial\dispatch.pyo", line 882, in <lambda>
File "mercurial\util.pyo", line 716, in check
File "mercurial\commands.pyo", line 1546, in commit
File "mercurial\cmdutil.pyo", line 2456, in commit
File "mercurial\commands.pyo", line 1540, in commitfunc
File "mercurial\localrepo.pyo", line 64, in wrapper
File "mercurial\localrepo.pyo", line 1508, in commit
File "mercurial\localrepo.pyo", line 64, in wrapper
File "mercurial\localrepo.pyo", line 1596, in commitctx
File "mercurial\extensions.pyo", line 168, in closure
File "c:/Users/543829657/workspace/mercurial-tools/commitsigs.py", line 357, in add
File "c:/Users/543829657/workspace/mercurial-tools/commitsigs.py", line 168, in opensslsign
File "subprocess.pyo", line 710, in __init__
File "subprocess.pyo", line 958, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
abort: The system cannot find the file specified
The variant with --debug
C:\Users\543829657\workspace\dev.appl.ib.cbl>hg commit --debug "--message=
Added a task Xml2Java for creation request/response files" --user "Petr Gangnus <petr.gangnus#moneta.cz>"
-- application/build.gradle
calling hook precommit.checkfiles: hghook_precommit_checkfiles.fixup_hook
checkfiles: removing tabs and/or trailing whitespace in changed files...
checkfiles: opts:
checkfiles: checked extensions:
checkfiles: ignored extensions: .sln .suo .vcproj .csproj .ui
checkfiles: ignored files:
checkfiles: check diffs only: False
checkfiles: use spaces: True
checkfiles: tab size: 4
checkfiles: considering files:
application/build.gradle
checkfiles: application/build.gradle ok
committing files:
application/build.gradle
committing manifest
committing changelog
transaction abort!
rollback completed
abort: The system cannot find the file specified
My colleagues and me had cleaned the project committed, re-cloned it, pulled changes or not, checked all python scripts and ssh keys for reachability... It should be OK, but it is not.
I have a suspision that while the error in the "--debug" variant appears after committing changelog, it could be something with it? I don't see any file that is named "changelog" in the project and there are three containing that word and they all are obviously old - cloned from repository.
About duplication of questions. It seems that that or similar message pops up in very many absolutely different situations:
Mercurial Editor: "abort: The system cannot find the file specified" - The commit fails in this very place of the same script, but... The stack itself is different, and there fails only the commit without the message. I have the message. And the author tries to use an alternative default editor and cannot - that is his problem, absolutely different from mine. I haven't changed the editor. I have not troubles with editor. I have installed hg, cloned project, changed one file and want to commit it - that is all.
TortoiseHg can't commit--"The system cannot find the file specified" - here the error message header is not "abort:", but "abort: Adding: "
android studio gradle refresh failed (The system cannot find the file specified) - here the commit is called from Android Studio and the file IS specified
"abort: The system cannot find the file specified" in Mercurial - the messages are almost the same, only the missing file IS specified by Mercurial. And the stack is different. And in my case I can update, whereas that author could not.
In others cases on SO with that error message it is not Mercurial what invokes the error.
I have looked at many similar cases on different sites, and I had not found the same problem. Always something important was different.
#Leon has supposed an interesting version below - that the reason is incorrectly set openssl/gnupg. I have checked installation of openssl, ran hg help commitsigs - and reading the ouput, noticed such interesting property as forcesign.
If the parametr is specified with a value of 1, the commit process will be
aborted and rolled back if the changeset cannot be signed for whatever reason
(bad setup, expired certificate and so on. The default is that the commit
will still be successful, but not signed.
Yes, it looks promising. ...But even setting that property to 0 changed nothing in the situation.
The commitsigs.py entries in your stack trace suggest that the problem is due to the Commitsigs Extension. Check that
you have gnupg or openssl installed on your system
you have a valid GPG key (in case of gnupg) or a X509 certificate (in case of openssl)
and Commitsigs is properly configured (run hg help commitsigs for details). In particular, the path to gnupg or openssl must be correctly specified, otherwise you may run into the described problem even when commitsigs.forcesign mode is disabled.

Strange response (about MySQL) for heroku login on windows (closed)

I have heroku toolbelt installed on Windows7 (x64 HomeEd). When i'm trying to login to heroku, i recieve strange message about MySQL (though MySQL already works fine with all software installed):
Microsoft Windows [Version 6.1.7601]
(c) Microsoft Corp., 2009. All rights reserved.
C:\windows\system32>heroku login
"MySQL" is not recognized as an internal or external command,
operable program or batch file.
"MySQL" is not recognized as an internal or external command,
operable program or batch file.
C:\windows\system32>
Exactly like shown - two times. As I found, heroku.bat does not invoke MySQL at any step. I think that OS runs some script (a kind of autoexec) just before or in parallel with heroku.bat, but i can't find the way used to do this. This is confirmed by the fact that when i start the other bat files the same two messages about MySQL appears.
Can you help me find how that strange script is invoked?
Detailed research shown that the reason is MySQL component, named "MySQL Fabric 1.5.3 & MySQL Utilities 1.5.3 1.5". During installation MySQL added it's location to Path environment variable. This caused to break Path variable contents with "&" symbol and any invocation of Path variable cause error
It seems that at some point a script tries to call MySQL.exe and this file can't be found. To solve this problem you should add the Directory containing MySQL.exe to %PATH%. First make sure MySQL.exe is located on your system. If you are not sure where it is, start CMD, go to your root directory (CD \) end enter dir /S MySQL.exe. This will search your drive for the file and show you the path, where it can be found. Save the path somewhere.
Now that you know where the file is is, you have to add it's location to %PATH%. To do so enter setx PATH "<NEWPATH>;%path%;" where is the path to the directory containing MySQL.EXE. Dont forget ;%path%;, this is very important. If you don't put it there it wil mess up your %PATH%.
Close the console, open a new one and type heroku login. This should fix the problem.
Now if you are not interested in fixing the error and just want to know where it comes from, you should post the code of the batch file that is executed by calling heroku login.
Just remove the C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\; from your path (It is breaking things up, it gets added during MySQL installation)and add the MySQL bin path. For me it is C:\Program Files\MySQL\MySQL Server 5.7\bin

how to fix "AttributeError: 'module' object has no attribute 'set_binary' "?

i compiled mercurial successfully as follows:
...
copying build/scripts-2.7/hg -> /usr/local/bin
changing mode of /usr/local/bin/hg to 755
running install_egg_info
Writing /usr/local/lib/python2.7/site-packages/mercurial-2.8.1-py2.7.egg-info
as3:~/mercurial-2.8.1# cd ~
as3:~# hg clone http://hg.cat-v.org/werc/
Traceback (most recent call last):
File "/usr/bin/hg", line 25, in <module>
mercurial.util.set_binary(fp)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 103, in __getattribute__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'set_binary'
as3:~#
how to fix it?tks.
my python version:2.7.6
Note that you have installed mercurial from sources into /usr/local/bin, but the error message mentions /usr/bin/hg. It means you have a different version of mercurial main script installed under /usr/bin/hg, which then tries to use new mercurial library from /usr/local. The error occurs, because the 2 are incompatible.
To fix this, remove older mercurial from /usr/bin. You may need to call rehash in your shell as well, for it to pick it up, depending on the shell.
If mercurial does not work then, it means /usr/local/bin is not in your PATH. If that is the case you'll need to fix the PATH, or just symlink new hg, like so:
# ln -s /usr/local/bin/hg /usr/bin
But that will require root access, for example, calling it through sudo.

Hosting Mercurial HG via VisualSVN Server

I have tried to host a Mercurial HG repository using a Scriptalias.
ScriptAlias /hg/ "htdocs/hgwebdir.cgi"
If I go to Chrome it display the contents of the cgi file. In IE it does render however images and links are not displayed. In either case the repository I want to display is not shown.
Has anyone managed to get this working with VisualSVN? Also will this work if I have windows authentication and https?
Here's a alternative setup using mod_wsgi (fast!), combined repository directory, and you can manage Mercurial repository level access from the VisualSVN Server GUI.
Download mod_wsgi.so for Apache 2.2 Win32 and place in "C:\Program Files\VisualSVN Server\bin".
Copy hgwebdir.wsgi from your Mercurial installation (contrib directory) to "C:\Program Files\VisualSVN Server\". It should look something like this:
import sys
sys.path.insert(0, "C:\Program Files\Mercurial\library")
from mercurial.hgweb.hgwebdir_mod import hgwebdir
application = hgwebdir('hgweb.config')
Create the config file "C:\Program Files\VisualSVN Server\hgweb.config".
[paths]
/ = c:/Repositories/*
Paste the following in "C:\Program Files\VisualSVN Server\conf\httpd-custom.conf". You should adjust the Auth* values based on the section of httpd.conf.
LoadModule wsgi_module bin/mod_wsgi.so
WSGIScriptAlias /hg "hgwebdir.wsgi"
<Location /hg/>
AuthName "Mercurial Repositories"
AuthType VisualSVN
AuthzVisualSVNAccessFile "C:/Repositories/authz-windows"
AuthnVisualSVNBasic on
AuthnVisualSVNIntegrated off
AuthnVisualSVNUPN Off
SVNParentPath "C:/Repositories/"
require valid-user
</Location>
Create a Mercurial repository:
hg init C:\Repositories\hgtest
You should now be able to access /hg through your browser, and manage repository level authorization through the VisualSVN Server tool.
Assuming you have Python 2.6 installed and working, here are the steps that I took.
Obtain "mod_cgi.so" built for Apache 2.2 Win32 and place it in "C:\Program Files\VisualSVN Server\bin".
Paste the following in "C:\Program Files\VisualSVN Server\conf\httpd-custom.conf"
LoadModule cgi_module bin/mod_cgi.so
ScriptAliasMatch ^/hg(.*) "cgi-bin/hgweb.cgi$1"
Create the cgi-bin directory, "C:\Program Files\VisualSVN Server\cgi-bin". And place hgweb.cgi in it. Make sure it looks similar to the following:
#!c:/Python26/python.exe -u
import sys
sys.path.insert(0, "C:\Program Files\Mercurial\library")
import cgitb
cgitb.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir
import mercurial.hgweb.wsgicgi as wsgicgi
application = hgwebdir('hgweb.config')
wsgicgi.launch(application)
Create a file called hgweb.config in the cgi-bin directory.
[paths]
/ = c:/HgRepositories/*
Copied "C:\Program Files\Mercurial\templates" to "C:\Program Files\Mercurial\library\templates".
Create "C:\HgRepositories" folder and "hg init c:\HgRepositories\test".
Restart VisualSVN Server, open browser, enjoy your Mercurial repository.
Starting with version 1.6 of Mercurial, the hgwebdir.wsgi script has
been unified with the hgweb.wsgi script. Wherever hgwebdir.wsgi is
referred to in these directions, you can substitute the hgweb.wsgi
script instead.
https://www.mercurial-scm.org/wiki/modwsgi
You can run hgwebdir behind different authentication and https modules just fine, provided your webserver handles them before the REMOTE_USER variable is handed off to the CGI.
I don't know visualsvn, but your ScriptAlias looks a lot like Apache. Do you need an AddHandler line for .cgi?

Mercurial Editor: "abort: The system cannot find the file specified"

I have a problem getting Mercurial to recognise my editor. I have a file, c:\windows\notepad.exe and typing "notepad" at the command prompt works. I can commit by using the "-m" argument to supply the commit title. But a simple "hg commit" brings up the error.
A call to "hg --traceback commit" brings up:
Traceback (most recent call last):
File "mercurial\dispatch.pyc", line 47, in _runcatch
File "mercurial\dispatch.pyc", line 466, in _dispatch
File "mercurial\dispatch.pyc", line 336, in runcommand
File "mercurial\dispatch.pyc", line 517, in _runcommand
File "mercurial\dispatch.pyc", line 471, in checkargs
File "mercurial\dispatch.pyc", line 465, in <lambda>
File "mercurial\util.pyc", line 401, in check
File "mercurial\commands.pyc", line 708, in commit
File "mercurial\cmdutil.pyc", line 1150, in commit
File "mercurial\commands.pyc", line 706, in commitfunc
File "mercurial\localrepo.pyc", line 836, in commit
File "mercurial\cmdutil.pyc", line 1155, in commiteditor
File "mercurial\cmdutil.pyc", line 1184, in commitforceeditor
File "mercurial\ui.pyc", line 361, in edit
File "mercurial\util.pyc", line 383, in system
File "subprocess.pyc", line 470, in call
File "subprocess.pyc", line 621, in __init__
File "subprocess.pyc", line 830, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
abort: The system cannot find the file specified
I've tried setting the HGEDITOR environment variable, setting "visual =" and "editor =" in the Mercurial.ini file. I tried full path as well as command only. I also tried copying the notepad.exe file into both the current folder as well as the mercurial folder.
Ideally I would like to use the editor at this location "C:\PortableApps\Notepad++Portable\Notepad++Portable.exe", but at this stage I would be happy with any editor!
HG debugconfig output:
c:\wamp\www\SiteAB.com\web>hg debugconfig
bundle.mainreporoot=c:\wamp\www\SiteAB.com\web
ui.username=killroy
ui.shell=true
ui.verbose=true
ui.visual="C:\PortableApps\Notepad++Portable\Notepad++Portable.exe"
ui.editor="C:\PortableApps\Notepad++Portable\Notepad++Portable.exe"
That editor = notepad didn't work suggests something is wrong with your environment. Since running notepad from the command line works, I wonder if maybe the problem is with your python installation. Your backtrace makes me think you're running hg 1.5 which was current when you posted. While I don't believe it should make a difference, it couldn't hurt to update to 1.5.4.
You're running Notepad++Portable from your C: drive. Usually one installs PortableApps to a removable drive. Are you sure hg should look at C:? I understand sometimes it can be handy for unpriviledged users to install them locally. Notepad++Portable won't play particularly nice with hg. You'll need to have npp completely closed and spawn it from hg or commits won't work. If you can, I'd try running the full version of Notepad++ instead. Here's what I use:
[ui]
editor = "C:\Program Files\Notepad++\notepad++.exe" -multiInst -nosession
-multiInst tells npp to open a new instance just for hg. That way it won't interfere with any npp windows you already have open. This does not work with the PortableApps version.
-nosession tells npp not to open any files you previously had open, speeding startup times and reducing clutter. When I'm writing a commit message, I want to focus on my message, and not be distracted by a bunch of unrelated tabs.
When you set editor = in the Mercurial.ini file, you're doing it within the [ui] section, right?
After doing that maybe provide the output of hg debugconfig ?