Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to write a charm for Magento but running into an issue.

Here is the source for charm https://github.com/MoT3rror/Magento-Charm

The install works perfect. Still needs a lot of work but works.

I having trouble with database-relation-joined hook to run through. It is saying the file doesn't exist but I am able to edit it on that machine so it there. I gave the file execute privileges. I am stuck why I got the error.

Steps deploying charm

juju bootstrap
juju deploy mysql
juju deploy --repository=/home/$USER/charms/ local:precise/magento
juju add-relation mysql magento

Error:

2013-11-21 05:48:51 INFO juju.worker.uniter uniter.go:517 joining relation "magento:database mysql:db"
2013-11-21 05:48:51 INFO juju.worker.uniter uniter.go:543 joined relation "magento:database mysql:db"
2013-11-21 05:48:56 INFO juju.worker.uniter uniter.go:348 running "database-relation-joined" hook
2013-11-21 05:48:56 ERROR juju.worker.uniter uniter.go:350 hook failed: fork/exec /var/lib/juju/agents/unit-magento-0/charm/hooks/database-relation-joined: no such file or directory
2013-11-21 05:48:56 DEBUG juju.worker.uniter modes.go:423 ModeAbide exiting
2013-11-21 05:48:56 INFO juju.worker.uniter modes.go:421 ModeHookError starting
2013-11-21 05:48:56 DEBUG juju.worker.uniter.filter filter.go:418 want resolved event
2013-11-21 05:48:56 DEBUG juju.worker.uniter.filter filter.go:412 want forced upgrade true
2013-11-21 05:48:56 DEBUG juju.worker.uniter.filter filter.go:523 no new charm event

List of the files on the server. https://github.com/MoT3rror/Magento-Charm/blob/master/list%20of%20files.jpg

Also is there a way to update a charm without destroying the environment and bootstrapping the environment?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

When I checked out your charm the hook permissions were:

-rw-rw-r-- 1 1058 Nov 21 10:39 database-relation-joined

So you probably forgot to commit the files after setting your hooks to executable.

Running chmod +x * in your hook directory and then re-committing/pushing should solve your problem.

share|improve this answer
    
No luck. Still getting same error. –  Joshua Bixler Nov 21 '13 at 18:30
    
Ok then we are going to need more information, can you edit your question to include the steps you are taking to bootstrap your environment and deploy the charm plz –  hatch Nov 21 '13 at 18:36
    
I included the steps in my question. Also I just tried changing the file to just have juju-log command and it works. Going to step through my code and see which line is giving me trouble now. –  Joshua Bixler Nov 21 '13 at 19:05
    
After checking out your branch I followed my previous suggestion then followed your steps and the hook files executed as expected but with the error Database Name cannot be empty from the database-relation-joined hook. So it looks like the original issue was related to the permissions but that exposed another issue further down. –  hatch Nov 21 '13 at 20:12
    
I recreated the database-relation-joined with the same contents and ran that command and it worked. Now to see why database is null. Thanks! –  Joshua Bixler Nov 21 '13 at 20:39
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.