# problem with portupgrade/portmaster



## hirohitosan (Aug 13, 2013)

Hi there.

I tried to upgrade the ports. First `# portsnap fetch update` and after that I got this:


```
# portupgrade -ca
2 open conditionals:
	  at line 1287 (evaluated to true)
	 at line 1125 (evaluated to true)
make: fatal errors encountered -- cannot continue
/usr/local/lib/ruby/site_ruby/1.9/pkgtools/portsdb.rb:237:in `join': can't convert nil into String (TypeError)
	from /usr/local/lib/ruby/site_ruby/1.9/pkgtools/portsdb.rb:237:in `index_file'
	from /usr/local/lib/ruby/site_ruby/1.9/pkgtools/portsdb.rb:247:in `db_dir='
	from /usr/local/lib/ruby/site_ruby/1.9/pkgtools/portsdb.rb:167:in `setup'
	from /usr/local/lib/ruby/site_ruby/1.9/pkgtools/pkgtools.rb:242:in `init_pkgtools_global'
	from /usr/local/sbin/portupgrade:530: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>'
```

I also tried:


```
# portmaster -a

===>>> The value of DISTDIR cannot be empty
===>>> Aborting update

===>>> Killing background jobs
Terminated
===>>> Exiting
```

How can I fix this?

Thank you!


----------



## SirDice (Aug 13, 2013)

Please post the contents of your /etc/make.conf.


----------



## hirohitosan (Aug 13, 2013)

```
# cat /etc/make.conf
# added by use.perl 2013-06-18 16:48:41
PERL_VERSION=5.12.5
WITH_PKGNG=yes
```


----------



## spomerg (Aug 13, 2013)

*Getting The Same Errors Here Too*

I too am getting the same errors when using any of the package tools that use Ruby (portupgrade, portversion, pkgdb, etc.).

My /etc/make.conf:


```
KERNCONF?=GENERIC
#LICENSE_COMB=multi
# added by use.perl 2013-06-12 08:33:14
PERL_VERSION=5.14.4
```


----------



## spomerg (Aug 13, 2013)

I just re-ran portsnap and see a potential cause to the problem?


```
# portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found.
Fetching snapshot tag from isc.portsnap.freebsd.org... done.
Fetching snapshot metadata... done.
Updating from Tue Aug 13 06:26:24 PDT 2013 to Tue Aug 13 06:55:22 PDT 2013.
Fetching 3 metadata patches. done.
Applying metadata patches... done.
Fetching 3 metadata files... /usr/sbin/portsnap: cannot open b69f65635569ea6e20afbe406d1ec28b764d0ed2b2d32556c86633c65eccae54.gz: No such file or directory
metadata is corrupt.
```

@hirohitosan, are you getting this same result when you run portsnap?


----------



## DutchDaemon (Aug 13, 2013)

Got this too. Must be a temporary glitch in the ports system. Try again later. Corrupted pieces of the `portsnap` gzip/gunzip process are usually network/checksum related. They should disappear at the next run.


----------



## hirohitosan (Aug 14, 2013)

Now it's working; both portupgrade and portmaster. Problem fixed.


----------



## ghostcorps (Nov 22, 2013)

I am getting this error now. Was there any more info in the issue?

This is my first run since upgrading to FreeBSD 9.2. Which is possibly part of the problem.

/etc/make.conf

```
WITH_OPENSSL_PORT=yes
DISTDIR=/usr/ports/distfiles
```

[update]

When I run `#portmaster -n` as root I get something interesting and am looking into now.


```
===>>> No /usr/ports/home/ghostcorps exists, and no information
	===>>> about home/ghostcorps can be found in /usr/ports/MOVED

===>>> No valid installed port, or port directory given
===>>> Try portmaster --help

===>>> Killing background jobs
===>>> Exiting
```


----------



## wblock@ (Nov 22, 2013)

ghostcorps said:
			
		

> /etc/make.conf
> 
> ```
> WITH_OPENSSL_PORT=yes
> ...



It's best not to set variables unless the value being set is different from the default.  So the second line should be removed.

Something similar may be causing it to think your home directory is a ports directory.


----------



## ghostcorps (Nov 22, 2013)

Thanks for the tip  It has not changed though. I do not use any portmaster.rc files. Why would portmaster change its default behaviour as though I had a user specific configuration? Much the thing happens if I run it as root on the console:
`#portmaster -n`

```
===>>> No /usr/ports//root exists, and no information
	===>>> about /root can be found in /usr/ports/MOVED

===>>> No valid installed port, or port directory given
===>>> Try portmaster --help

===>>> Killing background jobs
===>>> Exiting
```


----------



## kpa (Nov 22, 2013)

That's what portmaster does if you don't give it a port name to work on, it assumes that you want to build a port from the current directory. This allows one to do for example:

`cd /usr/ports/net/mtr`
`portmaster`

I'm pretty sure this is an idea of the original portmaster author, Doug Barton. It's unusual that a command line tool implicitly operates on the current directory if no command line parameters are given.


----------



## ghostcorps (Nov 22, 2013)

Thanks. But I have been using portmaster for a few years and have never had to specify a directory before. If I run from within the port directory I get the same result.


----------



## kpa (Nov 22, 2013)

Do you have anything out of the ordinary set in env(1)?


----------



## wblock@ (Nov 22, 2013)

Or in /etc/make.conf...


----------



## ghostcorps (Nov 22, 2013)

kpa said:
			
		

> Do you have anything out of the ordinary set in env(1)?



Possibly but not that I am aware of. This is for my current session while in the ports dir.

`#env`

```
SHELL=/bin/csh
SSH_CLIENT=192.168.0.57 43387 22
LOGNAME=ghostcorps
PAGER=more
MAIL=/var/mail/ghostcorps
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
EDITOR=vi
ENV=/home/ghostcorps/.shrc
PWD=/usr/ports
TERM=xterm
SSH_TTY=/dev/pts/0
HOME=/root
USER=ghostcorps
SSH_CONNECTION=192.168.0.57 43387 192.168.0.2 22
BLOCKSIZE=K
HOSTTYPE=FreeBSD
VENDOR=amd
OSTYPE=FreeBSD
MACHTYPE=x86_64
SHLVL=1
GROUP=wheel
HOST=DOMAINNAME
REMOTEHOST=MyLaptop
```

@@wblock: I removed the DISTDIR parameter from make.conf as you suggested so now it is just this:
/etc/make.conf

```
WITH_OPENSSL_PORT=yes
```

The results do not change though.


----------



## ghostcorps (Nov 24, 2013)

I have found that if I run `portmaster -n` from / it will run from the correct distdir. But `portmaster -a` still fails:


`portmaster -av`

```
===>>> Returning to update check of installed ports

===>>> droid-fonts-ttf-20110324
===>>> evieext-1.1.1
===>>> ezm3-1.1_2
===>>> filebench-1.4.8.0.8
===>>> flock-2.19
===>>> frei0r-1.3_1
===>>> glproto-1.4.16
===>>> google-perftools-1.8.3
===>>> gperf-3.0.3
===>>> hptsvr-https-2.1.4

===>>> No ORIGIN in /var/db/pkg/hptsvr-https-2.1.4/+CONTENTS

===>>> Cannot continue
===>>> Aborting update

===>>> Killing background jobs
===>>> Exiting
```


hptsvr is the third party package for my Highpoint RAID array. I have been using it for years and while this notice does come up regularly it has never seemed to cause a problem before. Why could it be blocking me now? It seems many behaviours have changed in portmaster after the upgrade to 9.3.


[RESULT!!]

Another thread mentions this handy command which has worked perfectly.
`touch /var/db/pkg/hptsvr-https-2.1.4/+IGNOREME`


----------

