# multimedia/ffmpeg pkg_add: leave_playpen: can't chdir back to ''



## sk8harddiefast (Oct 2, 2013)

Somewhere I messed up my pkgdb. I try to install multimedia/ffmpeg, witch which is a dependency of a lot of packages and I get a strange error.


```
Creating bzip'd tar ball in '/usr/ports/multimedia/ffmpeg/ffmpeg-0.7.15_1,1.tbz'
===>  Installing for ffmpeg-0.7.15_1,1
===>  Checking if multimedia/ffmpeg already installed
share/doc/ffmpeg/APIchanges: Could not unlink
share/doc/ffmpeg/RELEASE_NOTES: Could not unlink
share/doc/ffmpeg/TODO: Could not unlink
share/doc/ffmpeg/avutil.txt: Could not unlink
share/doc/ffmpeg/build_system.txt: Could not unlink
share/doc/ffmpeg/developer.html: Could not unlink
share/doc/ffmpeg/faq.html: Could not unlink
share/doc/ffmpeg/fate.txt: Could not unlink
share/doc/ffmpeg/ffmpeg.html: Could not unlink
share/doc/ffmpeg/ffplay.html: Could not unlink
share/doc/ffmpeg/ffprobe.html: Could not unlink
share/doc/ffmpeg/ffserver.html: Could not unlink
share/doc/ffmpeg/general.html: Could not unlink
share/doc/ffmpeg/git-howto.txt: Could not unlink
share/doc/ffmpeg/issue_tracker.txt: Could not unlink
share/doc/ffmpeg/libavfilter.html: Could not unlink
share/doc/ffmpeg/multithreading.txt: Could not unlink
share/doc/ffmpeg/optimization.txt: Could not unlink
share/doc/ffmpeg/rate_distortion.txt: Could not unlink
share/doc/ffmpeg/snow.txt: Could not unlink
share/doc/ffmpeg/soc.txt: Could not unlink
share/doc/ffmpeg/swscale.txt: Could not unlink
share/doc/ffmpeg/tablegen.txt: Could not unlink
share/doc/ffmpeg/viterbi.txt: Could not unlink
tar: Error exit delayed from previous errors.
[B]pkg_add: leave_playpen: can't chdir back to ''[/B]
*** [install-package] Error code 2

Stop in /usr/ports/multimedia/ffmpeg.
*** [install] Error code 1

Stop in /usr/ports/multimedia/ffmpeg.
```
I cannot understand why this happens. I google the problem but have not found something to help me.


----------



## archan127 (Oct 3, 2013)

I'm in the process of building all of the ports I need for my shiny new 9.2-RELEASE and I'm installing  KDE4-4.10.5 using portmaster. While I was trying to install ffmpeg, I had _exactly_ the same error message as the one you posted. I have never seen this error message, and I've never had an issue building ffmpeg before. I will admit that I stopped using FreeBSD for about 3 or 4 months and have not kept up on all of the changes to the portstree. It seems ffmpeg compiles correctly, but the installation is hung up somewhere. Any guidance from anyone would be much appreciated. Thank you.


----------



## sk8harddiefast (Oct 3, 2013)

I get errors everywhere.
Trying to recomplile all system packages

```
install  -o root -g wheel -m 444 include/opus.h include/opus_multistream.h include/opus_types.h include/opus_defines.h include/opus_custom.h '/usr/ports/audio/opus/work/stage/usr/local/include/opus'
====> Compressing man pages
===>  Building package for opus-1.0.3
Creating package /usr/ports/audio/opus/opus-1.0.3.tbz
Registering depends:.
Creating bzip'd tar ball in '/usr/ports/audio/opus/opus-1.0.3.tbz'
===>  Installing for opus-1.0.3
===>  Cleaning for opus-1.0.3
--->  Cleaning out obsolete shared libraries
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 1018 packages found (-0 +1) . done]
** No origin recorded: portmaster-3.17.2
** Specify one with -o option, or run 'pkgdb -F' to interactively fix it.
/usr/local/lib/ruby/site_ruby/1.9/pkgtools/pkgtools.rb:964:in `initialize': ArgumentError (ArgumentError)
        from /usr/local/sbin/portupgrade:1060:in `new'
        from /usr/local/sbin/portupgrade:1060:in `rescue in do_upgrade'
        from /usr/local/sbin/portupgrade:1063:in `do_upgrade'
        from /usr/local/sbin/portupgrade:855:in `block (2 levels) in main'
        from /usr/local/sbin/portupgrade:850:in `each'
        from /usr/local/sbin/portupgrade:850:in `block in main'
        from /usr/local/lib/ruby/1.9/optparse.rb:882:in `initialize'
        from /usr/local/sbin/portupgrade:237:in `new'
        from /usr/local/sbin/portupgrade:237:in `main'
        from /usr/local/sbin/portupgrade:2371:in `<main>'
```

and

`[ember@Unix /usr/home/ember]$ pkg_info | grep ffmpeg`

```
pkg_info: corrupted record for package alsa-plugins-1.0.26 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package deadbeef-0.5.5_4 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package ffmpegthumbnailer-2.0.8_2 (pkgdep line without argument), ignoring
ffmpeg1-1.2.3       Realtime audio/video encoder/converter and streaming server
ffmpegthumbnailer-2.0.8_2 Lightweight video thumbnailer that can be used by file mana
pkg_info: corrupted record for package frei0r-plugins-1.3 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package frei0r-plugins-opencv-1.3_2 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package gegl-0.2.0_3 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package gimp-2.8.6,2 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package gimp-app-2.8.6_1,1 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package gimp-gutenprint-5.2.8 (pkgdep line without argument), ignoring
gstreamer-ffmpeg-0.10.13_1 GStreamer plug-in for manipulating MPEG video streams
pkg_info: corrupted record for package gstreamer-plugins-all-1.3.0.10.1_14 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package gstreamer-plugins-mpeg2enc-0.10.23,3 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package gstreamer-plugins-opencv-0.10.23,3 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package gutenprint-5.2.8 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package k3b-2.0.2_12 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package kde-4.10.5 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package kde-workspace-4.10.5 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package kdeartwork-4.10.5 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package kdenetwork-4.10.5 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package kdenlive-0.9.6_1 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package kdeplasma-addons-4.10.5 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package libquicktime-1.2.4_4 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package minitube-2.0 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package mjpegtools-2.0.0_4 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package mlt-0.9.0 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package opencv-2.3.1_7 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package phonon-gstreamer-4.6.3 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package py27-gimp-app-2.8.6_1 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package sox-14.3.2_6 (pkgdep line without argument), ignoring
pkg_info: corrupted record for package transcode-1.1.7_8 (pkgdep line without argument), ignoring
```

As far as I understood is not ffmpeg's problem. Something is very wrong in packages database and that makes me afraid a lot.
OR ffmpeg has build issiue and because I remove it and now I cannot install it back, my package database just broke up.


----------



## jb_fvwm2 (Oct 3, 2013)

"leave_playpen" also has counfounded cross-machine (via thumbdrive) package installs here year after year.  I also would like a fix for that error, and if possible information as to whether the cause would be fixed if one was using  ports-mgmt/pkg  instead... Seems like a not-trivial issue here.


----------



## archan127 (Oct 3, 2013)

Hello jb... I was considering upgrading to PKGNG and using those tools, but the lack of a central repository has stopped me from doing so. If this helps, trying to install ffmpeg using the `pkg_add -r ffmpeg` command fails as well. It seems to download and prepare the package okay, but once it gets to the install stage it comes up with that strange error. At this point I am going to try and install KDE4 without ffmpeg at all and at least get the GUI up and running so I do not have to keep switching between FreeBSD and Windows. Oddly enough, ffmpeg is the only port that is giving me problems. All other ports install without any problems whatsoever. I may consider dumping the whole install and starting from scratch again, building ports doesn't take that long, and its a learining experience each time.


----------



## sk8harddiefast (Oct 3, 2013)

Yes. `pkg_add -r ffmpeg` gives me exact the same error. The problem is not only ffmpeg for me. Is also my corrupted database because of this package*.*
My system now is a complete mess. I used xfce4 with a lot of plugins and apps like `thunar`,`ristretto` etc. Now I moved to kde4, I deleted a big number of packages and still I have over 1000! I don't know which are needed, I try to find out why they are so much and just I cannot even recompile everything. If that sounds bad, it's worst!

update:


```
pkg_info: corrupted record for package (pkgdep line without argument), ignoring
```
For this the solution found here:
http://forums.freebsd.org/showthread.php?t=13899

I hope that things can get better.


----------



## archan127 (Oct 4, 2013)

I'm sure it*'*s no help, but the only things I can come up with are corrupt sectors on the hard drive (like anyone has to worry about that with today*'*s hard drives), or bad directory/folder permissions. Personally I'm wiping my hard drive out now and starting again from scratch, but I don't have much to lose since I just started to compile my ports a couple of days ago. It*'*s such an odd error.


----------



## NecAway (Oct 4, 2013)

I have the same error while trying to build in a clean jail.


----------



## sk8harddiefast (Oct 4, 2013)

I run `fsck` twice on single user mode. I didn't get something unusual. Searching on Google again for the same problem, one answer was to make filesystem rewritable. But my filesystem is in rw mode. I still cannot understand if this is ports compile error or hardware / permission error.


----------



## timeout (Oct 4, 2013)

I'm getting this error as well. Has a solution been found yet? Install ends with the exact same error message as in the first message in this thread.


----------



## timeout (Oct 4, 2013)

Actually, the interesting thing about this is that ffmpeg is already installed on my system. And now, it's showing up as a dependency for chromium, and causing the errors, stopping me from being able to install chrome.

My pkg database seems to be ok, though. Although I'm only basing this on the fact that it's not returning garbage, when I use it.


----------



## sk8harddiefast (Oct 4, 2013)

Ok. Now for sure is not HDD's bad sector or permission problem. All of as, just we crashed HDD's sector and exactly on the same time or we changed HDD's permissions?

At least now I recompile all my packages. I am on 
	
	



```
59885  2  S+      0:47.95 ruby19: portupgrade: [648/1030] qt4-gui-4.8.4 (ruby19)
```

And a question that have nothing to do with the ffmpeg error but all the list of my apps is:
gimp, kolourpaint, xorg-minimal, nvidia, nvidia-settings, kde4 as minimal as possible, firefox, deadbeef, vlc, minitube, virtualbox, ImageMagick, k3b, transmission, geany, zenmap, libreoffice, kdenlive, supertuxkart, all gstreamers, some gtk-engines, etherape, hydra, conky, kismet, aircrack-ng, ettercap, cups, and some fonts. Can this be 1030 packages? There are too many. This is my `pkg_info` http://pastebin.com/8qxvhT6c  and I try to find out what to deinstall to make it slimer


----------



## timeout (Oct 4, 2013)

Thanks to 'Orum on #freebsd, the problem is that there are multiple versions of ffmpeg in the ports tree.

I'm not sure, but in my case, installing multimedia/ffmpeg was not succeeding (I'm not sure, which port pulled it in originally as a dependency, perhaps mplayer?). 

Try installing multimedia/ffmpeg-devel and see if that fixes your problem? This is not an ideal solution, but at least will get you a running ffmpeg application that _is registered_ in the package database.


----------



## Hanky-panky (Oct 4, 2013)

archan127 said:
			
		

> I'm in the process of building all of the ports I need for my shiny new 9.2-RELEASE and I'm installing  KDE4-4.10.5 using portmaster. While I was trying to install ffmpeg, I had _exactly_ the same error message as the one you posted. I have never seen this error message, and I've never had an issue building ffmpeg before. I will admit that I stopped using FreeBSD for about 3 or 4 months and have not kept up on all of the changes to the portstree. It seems ffmpeg compiles correctly, but the installation is hung up somewhere. Any guidance from anyone would be much appreciated. Thank you.


Exactly same problem here. The port compile fine then it crash with the same error during pkg_add install fase. A bug, that's for sure. Developer should look at it. Many packages need it so I'm also stuck in the middle of nowhere, becouse pkg_add error went during an update and after the original package was deinstalled, so there is no more ffmpeg installed in my system. Too bad. Hope someone can come here with a workaround before developer fix the problem.


PS: my system is not broken in any way, there is just this ffmpeg problem, every other software compile and install fine and nicely.


----------



## sk8harddiefast (Oct 4, 2013)

I installed multimedia/ffmpeg-devel. This compiled without any problem.


----------



## andreash (Oct 4, 2013)

Hello together, hello FreeBSD forum (-:

I had that problem also. I replaced ffmpeg with ffmpeg1 (ffmpeg2 also available)


```
# portmaster -o multimedia/ffmpeg1 multimedia/ffmpeg
```
It worked fine, no compile-error. Actually I'm recompiling all ports (`# portmaster -af`)

Let's see what happens.

   Andreas


----------



## timeout (Oct 4, 2013)

But how can I install chrome? When I install chromium, the port tries to install ffmpeg and fails!


----------



## sk8harddiefast (Oct 4, 2013)

If you install ffmpeg1 or ffmpeg-devel, still asks for ffmpeg?
Also, if you build it without codecs support? At least for now until we get a fix.
`cd /usr/ports/www/chromium`
`make config` (here uncheck codecs support)
`make install clean`


----------



## NecAway (Oct 4, 2013)

Solved.


```
[Fri 22:53 root@nec] /usr/ports#cat /usr/local/share/doc/ffmpeg
0.7.15
[Fri 22:53 root@nec] /usr/ports#rm /usr/local/share/doc/ffmpeg
[Fri 22:53 root@nec] /usr/ports#mkdir /usr/local/share/doc/ffmpeg
```
After that:

```
[Fri 22:56 root@nec] /usr/ports#portmaster multimedia/ffmpeg

===>>> Port directory: /usr/ports/multimedia/ffmpeg
... ... ... ...
... ... ... ...
===>>> Installation of multimedia/ffmpeg (ffmpeg-0.7.15_1,1) complete

===>>> Exiting
```

Could somebody explain to me, by giving an example, how to send a PR?


----------



## sk8harddiefast (Oct 4, 2013)

Yes. That worked! ffmpeg is back


----------



## Hanky-panky (Oct 4, 2013)

NecAway said:
			
		

> Solved.



Yeppazzz!!!

Thank you, good brother, thank you!


----------



## sk8harddiefast (Oct 4, 2013)

Russian power    :beer :beer


----------

