Charm needed: Trac

Bug #795480 reported by Ahmed Kamal on 2011-06-10
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charms Collection
Wishlist
Ramez Hanna

Bug Description

Formula needed trac. Project management and bug/issue tracking system. Provides an interface to Subversion and an integrated wiki.

Ahmed Kamal (kim0) on 2011-06-10
Changed in principia:
importance: Undecided → Wishlist
summary: - Formula needed trac
+ Formula needed: Trac
Changed in principia:
assignee: nobody → Ahmed El Gamil (ahmedelgamil)
Jorge Castro (jorge) on 2011-07-12
tags: added: bitesize

Pushed an initial commit at https://code.launchpad.net/~ahmedelgamil/charm/oneiric/trac/trunk, need to update that for Juju's new features (set-config .. etc)

Changed in charm:
status: New → In Progress
summary: - Formula needed: Trac
+ Charm needed: Trac
Ramez Hanna (rhanna) on 2013-12-11
Changed in charms:
status: In Progress → Fix Committed
assignee: Ahmed El-Gamil (ahmedelgamil) → Ramez Hanna (rhanna)
Antonio Rosales (arosales) wrote :

Ramez,

Thanks for working on the trac charm and your submission for inclusion into the charm store. I have the following feedback.

# Deployment.
I am unable to get your charm deployed in local, AWS, or HP cloud. On deployment I get a hook failed error:
services:
  trac:
    charm: local:precise/trac-3
    exposed: true
    units:
      trac/0:
        agent-state: error
        agent-state-info: 'hook failed: "config-changed"'
        agent-version: 1.16.5
        machine: "1"

# Charm Proof warnings and info:
W: No icon.svg file.
I: relation website has no hooks
Suggest to add a trac charm icon, and you call out a website relation in the metadata.yaml but no specific hook.

# Copyright
Your copyright file is blank. Could you please assign the appropriate copyright.

# Readme and metadata.yaml description
In your metadata.yaml you put example usage in the description. Suggest to move the usage example the readme, and give an overview to the trac charm in the metadata.yaml description. Suggest your full name for the maintainer field. For the readme this is the file users will utilize to learn how to use your charm. Thus, we would like to be informative as possible. Suggest to run 'charm add readme' to get a good template (ensure you are running charm-tools 1.2.5 or greater). It would also be a plus to include in your readme how you use Ansible playbooks and charm helpers in your charm.

# Knitpicks
Suggest to remove .git from the bzr branch

# Comments
The initial deployment needs fixing (ie resolve the config-changed hook failure), and highly recommend making the readme file more robust. Additional information about submitting to the charm store can be found at: https://juju.ubuntu.com/docs/authors-charm-store.html

I am going to move the status of this bug into "incomplete" please move the bug back to "fix committed" when you are ready for another review.

-thanks,
Antonio

Changed in charms:
status: Fix Committed → Incomplete
Benjamin Saller (bcsaller) wrote :

It appears the fix for the config-changed hook is:

=== modified file 'playbooks/config-changed.yml'
--- playbooks/config-changed.yml 2013-12-11 22:43:07 +0000
+++ playbooks/config-changed.yml 2013-12-16 19:12:36 +0000
@@ -19,7 +19,7 @@
   file: src=/etc/apache2/sites-available/trac.conf dest=/etc/apache2/sites-enabled/trac.conf state=link

 - name: remove 000-default
- file: src=/etc/apache2/sites-enabled/000-default state=absent
+ file: path=/etc/apache2/sites-enabled/000-default state=absent

This seemed to resolve it for me anyway.

yeah that was an uncommited change
I fixed and pushed
now working on the other commits

On Mon, Dec 16, 2013 at 9:13 PM, Benjamin Saller
<email address hidden> wrote:
> It appears the fix for the config-changed hook is:
>
> === modified file 'playbooks/config-changed.yml'
> --- playbooks/config-changed.yml 2013-12-11 22:43:07 +0000
> +++ playbooks/config-changed.yml 2013-12-16 19:12:36 +0000
> @@ -19,7 +19,7 @@
> file: src=/etc/apache2/sites-available/trac.conf dest=/etc/apache2/sites-enabled/trac.conf state=link
>
> - name: remove 000-default
> - file: src=/etc/apache2/sites-enabled/000-default state=absent
> + file: path=/etc/apache2/sites-enabled/000-default state=absent
>
> This seemed to resolve it for me anyway.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/795480
>
> Title:
> Charm needed: Trac
>
> Status in Juju Charms:
> Incomplete
>
> Bug description:
> Formula needed trac. Project management and bug/issue tracking system.
> Provides an interface to Subversion and an integrated wiki.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/charms/+bug/795480/+subscriptions

--
BR
RH
http://informatiq.org

Ramez Hanna (rhanna) wrote :

just commited fixes for upmentioned issues and other mysql related ones

Changed in charms:
status: Incomplete → Fix Committed
Benjamin Saller (bcsaller) wrote :

Thanks again for the effort you've put into this.

I've tested the most recent push of this with sqlite and mysql (via relation) with both local provider and on EC2. In none of those situations was I able to get this to work. That said I still believe this should be close to working and would be happy to test it again and do a complete review after you've had time to look at it again.

Have you successfully deployed in those environments?

Changed in charms:
status: Fix Committed → Incomplete
Ramez Hanna (rhanna) wrote :

I have deployed on local but not EC2

Would help a lot if you tell me what is not working or any errors showing

On Wed, Jan 8, 2014 at 1:02 AM, Benjamin Saller
<email address hidden> wrote:
> Thanks again for the effort you've put into this.
>
> I've tested the most recent push of this with sqlite and mysql (via
> relation) with both local provider and on EC2. In none of those
> situations was I able to get this to work. That said I still believe
> this should be close to working and would be happy to test it again and
> do a complete review after you've had time to look at it again.
>
> Have you successfully deployed in those environments?
>
> ** Changed in: charms
> Status: Fix Committed => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/795480
>
> Title:
> Charm needed: Trac
>
> Status in Juju Charms:
> Incomplete
>
> Bug description:
> Formula needed trac. Project management and bug/issue tracking system.
> Provides an interface to Subversion and an integrated wiki.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/charms/+bug/795480/+subscriptions

--
BR
RH
http://informatiq.org

Benjamin Saller (bcsaller) wrote :
Download full text (6.0 KiB)

Yes, happy to post additional data, I was looking for confirmation that this was working for you before continuing.

On local provider:
juju bootstrap
juju deploy --repository local:precise/trac
and then going to the port of the trac instance yields:

    Error
  TracError: IOError: [Errno 2] No such file or directory: '/srv/trac/trac/VERSION'

in the browser. Trac agent state is started at this point.

Attempting to transition to the mysql version.

juju set trac db_backend=mysql
juju add-relation trac mysql

results in the database relation hook being trigger more than once, on the second run I see::
TASK: [init mysql trac env] ***************************************************
failed: [localhost] => {"changed": true, "cmd": ["trac-admin", "/srv/trac/trac", "initenv", "trac", "mysql://iathoosohajainu:ouxuxeeyeteigee@10.0.3.225:3306/trac"], "delta": "0:00:00.285123", "end": "2014-01-10 02:37:29.440815", "item": "", "rc": 1, "start": "2014-01-10 02:37:29.155692"}
stderr: Initenv for '/srv/trac/trac' failed.
Failed to create environment.
(1050, "Table 'system' already exists")
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/trac/admin/console.py", line 422, in do_initenv
    options=options)
  File "/usr/lib/python2.7/dist-packages/trac/env.py", line 213, in __init__
    self.create(options)
  File "/usr/lib/python2.7/dist-packages/trac/env.py", line 401, in create
    DatabaseManager(self).init_db()
  File "/usr/lib/python2.7/dist-packages/trac/db/api.py", line 146, in init_db
    connector.init_db(**args)
  File "/usr/lib/python2.7/dist-packages/trac/db/mysql_backend.py", line 107, in init_db
    cursor.execute(stmt)
  File "/usr/lib/python2.7/dist-packages/trac/db/util.py", line 66, in execute
    return self.cursor.execute(sql)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1050, "Table 'system' already exists")
stdout: Creating and Initializing Project

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/home/ubuntu/sites.retry

localhost : ok=3 changed=1 unreachable=0 failed=1

Traceback (most recent call last):
  File "./hooks/database-relation-changed", line 19, in <module>
    hooks.execute(sys.argv)
  File "/var/lib/juju/agents/unit-trac-0/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 164, in execute
    self.playbook_path, tags=[hook_name])
  File "/var/lib/juju/agents/unit-trac-0/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 111, in apply_playbook
    subprocess.check_call(call)
  File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'playbooks/sites.yml', '--tags', 'database-relation-changed']' returned non-zero exit status 2

and in the browser trac presents an error screen with t...

Read more...

Antonio Rosales (arosales) wrote :

Ramez,

Hello, I wanted to touch base with you and see if you were able to get the charm deploying and if so perhaps you feel it is ready for a review into the charm store.

We would very much like to see your contributions land in the charm store.

Ping in #juju if you have any questions or feel free to reply here.

-thanks,
Antonio

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers