# Apache 2.4 failing to install from ports in FreeBSD

**URL:** <https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360>\
**Category:** Ansible Project\
**Created:** [May 29, 2014, 5:42am UTC](https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360 "2014-05-29T05:42:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [May 29, 2014, 5:42am UTC](https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360/1 "2014-05-29T05:42:45Z")

</div>

I have tried

- name: Install apache from ports  
portinstall: name=apache24

and

- name: Install apache from ports  
portinstall: name=www/apache24

And every time it crashes with:

-------------- error

fatal: [test1] =\> failed to parse: Traceback (most recent call last):  
File “/root/.ansible/tmp/ansible-tmp-1401356164.88-83095021216464/portinstall”, line 1407, in   
main()  
File “/root/.ansible/tmp/ansible-tmp-1401356164.88-83095021216464/portinstall”, line 200, in main  
install\_packages(module, pkgs, p[“use\_packages”])  
File “/root/.ansible/tmp/ansible-tmp-1401356164.88-83095021216464/portinstall”, line 170, in install\_packages  
matches = matching\_packages(module, package)  
File “/root/.ansible/tmp/ansible-tmp-1401356164.88-83095021216464/portinstall”, line 104, in matching\_packages  
occurrences = int(parts[0])  
ValueError: invalid literal for int() with base 10: ‘www/apache24’

FATAL: all hosts have already failed – aborting

-------------- error

Any ideas why?  
Installing manually works without problems

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [May 29, 2014, 5:53am UTC](https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360/2 "2014-05-29T05:53:38Z")

</div>

Adding higher levels of verbosity:

TASK: [freebsd-django | Install apache from ports] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<162.242.223.246\> ESTABLISH CONNECTION FOR USER: root  
\<162.242.223.246\> REMOTE\_MODULE portinstall name=www/apache24  
\<162.242.223.246\> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=2222’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘162.242.223.246’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609 && echo $HOME/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609’”]  
\<162.242.223.246\> PUT /tmp/tmpgLsOxv TO /root/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609/portinstall  
\<162.242.223.246\> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=2222’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘162.242.223.246’, “/bin/sh -c ‘/usr/local/bin/python /root/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609/portinstall; rm -rf /root/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609/ \>/dev/null 2\>&1’”]  
fatal: [test1] =\> failed to parse: Traceback (most recent call last):  
File “/root/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609/portinstall”, line 1407, in   
main()  
File “/root/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609/portinstall”, line 200, in main  
install\_packages(module, pkgs, p[“use\_packages”])  
File “/root/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609/portinstall”, line 170, in install\_packages  
matches = matching\_packages(module, package)  
File “/root/.ansible/tmp/ansible-tmp-1401357126.38-269635003321609/portinstall”, line 104, in matching\_packages  
occurrences = int(parts[0])  
ValueError: invalid literal for int() with base 10: ‘www/apache24’

FATAL: all hosts have already failed – aborting

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [May 29, 2014, 6:11am UTC](https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360/3 "2014-05-29T06:11:23Z")

</div>

Solved  
Was missing  
state=present

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [May 29, 2014, 11:35am UTC](https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360/4 "2014-05-29T11:35:43Z")

</div>

It should default to that and not stacktrace, it is still a bug.

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [May 29, 2014, 1:29pm UTC](https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360/5 "2014-05-29T13:29:28Z")

</div>

Have to do more testing today… I think it was crashing even after adding that…  
Will git pull latest code… and retry

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [May 29, 2014, 1:47pm UTC](https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360/6 "2014-05-29T13:47:51Z")

</div>

I suspect it is the version matching code, often a headache for those dealing with FreeBSD packages.

Brian Coca

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 31, 2014, 4:27pm UTC](https://forum.ansible.com/t/apache-2-4-failing-to-install-from-ports-in-freebsd/15360/7 "2014-05-31T16:27:05Z")

</div>

Tracebacks are bugs, so please file this regardless.
