Opened 13 years ago

Closed 13 years ago

#27354 closed defect (fixed)

nginx @0.8.53_0 installation failure/warnings on update

Reported by: ast@… Owned by: boeyms@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: usability Cc:
Port: nginx

Description

Did an unattended update/upgrade based on twitter comment from @macports that version 0.8.53 was available, but resulted in an installation error and replacement of active nginx.conf configuration file.

I would've expected the update not to fail, and I would've expected the new default config to overwrite the original nginx.conf.example

Selected log snippets below:

$ sudo port selfupdate
Password:
--->  Updating the ports tree
--->  Updating MacPorts base sources using rsync
MacPorts base version 1.8.2 installed,
MacPorts base version 1.9.2 downloaded.
--->  MacPorts base is outdated, installing new version 1.9.2
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl


The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
$ sudo port upgrade outdated

.... build the world ....

--->  Attempting to fetch nginx-0.8.53.tar.gz from http://lil.fr.distfiles.macports.org/nginx
--->  Verifying checksum(s) for nginx
--->  Extracting nginx
--->  Applying patches to nginx
--->  Configuring nginx
--->  Building nginx
--->  Staging nginx into destroot
--->  Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting nginx with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo port load nginx
###########################################################
Warning: violation by /opt/local/html
Warning: nginx violates the layout of the ports-filesystems!
Warning: Please fix or indicate this misbehavior (if it is intended), it will be an error in future releases!
--->  Computing dependencies for nginx
--->  Installing nginx @0.8.53_0
--->  Deactivating nginx @0.7.64_0
--->  Activating nginx @0.8.53_0
Error: Target org.macports.activate returned: Image error: /opt/local/etc/nginx/mime.types already exists and does not belong to a registered port.  Unable to activate port nginx. Use 'port -f activate nginx' to force the activation.
Log for nginx is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_nginx/main.log

... build the rest of the world ...

Since this was an unattended update, I didn't notice the errors. There should be some way to highlight that some of the things you wanted to update didn't work at the end of the update. The only reason I did the update at all was to update nginx and it didn't work afterwards.

Here's the end of the messages:

--->  Verifying checksum(s) for tk
--->  Extracting tk
--->  Configuring tk
--->  Building tk
--->  Staging tk into destroot
--->  Computing dependencies for tk
--->  Installing tk @8.5.9_0
--->  Deactivating tk @8.5.8_0+darwin
--->  Activating tk @8.5.9_0
--->  Cleaning tk
--->  Computing dependencies for wget
--->  Fetching wget
--->  Verifying checksum(s) for wget
--->  Extracting wget
--->  Applying patches to wget
--->  Configuring wget
--->  Building wget
--->  Staging wget into destroot
--->  Computing dependencies for wget
--->  Installing wget @1.12_3+ssl
--->  Deactivating wget @1.12_0
--->  Activating wget @1.12_3+ssl
To customize wget, you can copy wgetrc.sample to wgetrc
in /opt/local/etc and then make changes.
--->  Cleaning wget

The next morning, I then went to see if it was there:

$ nginx -v
-bash: nginx: command not found
$ nginx
-bash: nginx: command not found
$ ps -ef | grep nginx
    0 46864     1   0   0:00.00 ??         0:00.00 nginx: master process nginx
   -2 46865 46864   0   0:00.09 ??         0:00.15 nginx: worker process
   -2 46866 46864   0   0:04.04 ??         0:06.78 nginx: worker process
   -2 46867 46864   0   0:03.83 ??         0:06.42 nginx: worker process
   -2 46868 46864   0   0:03.94 ??         0:06.63 nginx: worker process
   -2 46869 46864   0   0:03.71 ??         0:06.29 nginx: worker process
   -2 46870 46864   0   0:03.90 ??         0:06.64 nginx: worker process
 1000 32019  1760   0   0:00.00 ttys000    0:00.00 grep nginx
$ which nginx
$ sudo which nginx
Password:
$ sudo sh
sh-3.2# su - root
miyu:~ root# which nginx
miyu:~ root# nginx
-sh: nginx: command not found
miyu:~ root# exit
logout
sh-3.2# exit
exit
$ sudo port install nginx
--->  Computing dependencies for nginx
--->  Activating nginx @0.8.53_0
Error: Target org.macports.activate returned: Image error: /opt/local/etc/nginx/mime.types already exists and does not belong to a registered port.  Unable to activate port nginx. Use 'port -f activate nginx' to force the activation.
Log for nginx is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_nginx/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
$ sudo port -f activate nginx
--->  The following versions of nginx are currently installed:
--->      nginx @0.7.64_0
--->      nginx @0.8.53_0
Error: port activate failed: Registry error: Please specify the full version as recorded in the port registry.
$ sudo port -f update nginx
Unrecognized action "update"
$ sudo port -f upgrade nginx
$ nginx
-bash: nginx: command not found
$ which nginx
$ sudo port -f install nginx
--->  Computing dependencies for nginx
--->  Activating nginx @0.8.53_0
Warning: File /opt/local/etc/nginx/mime.types already exists.  Moving to: /opt/local/etc/nginx/mime.types.mp_1289927499.
Warning: File /opt/local/etc/nginx/nginx.conf already exists.  Moving to: /opt/local/etc/nginx/nginx.conf.mp_1289927499.
--->  Cleaning nginx
$ nginx -v
nginx version: nginx/0.8.53
$ cd /opt/local/etc/nginx
$ ls
fastcgi.conf			nginx.conf
fastcgi.conf.example		nginx.conf.example
fastcgi_params			nginx.conf.mp_1289927499
fastcgi_params.example		scgi_params
koi-utf				scgi_params.example
koi-win				uwsgi_params
mime.types			uwsgi_params.example
mime.types.example		win-utf
mime.types.mp_1289927499
$ vi nginx.conf
$ sudo mv nginx.conf nginx.conf.sample
$ sudo mv nginx.conf.mp_1289927499 nginx.conf

I wouldn't actually use the port system much, but I do use a lot of standard UNIX software. I started using UNIX in 1989, bought a NeXT and used NEXTSTEP as my primary platform from 1991-2000, then migrated to Linux until earlier this year when I bought the MacBook, so I certainly have an idea on how to use the command line and other tools like this (yum, apt, redcarpet, etc.). :)

I actually would've expected the port command to fail at the point where it choked on the nginx install, but instead, it rendered previously working software non-functional. Is this by design?

As you can see above, I did get it working, but without wading through thousands of lines of scrollback buffer, I would've never discovered the installation issue any other way than I actually did: trying to run the updated software.

Hopefully the above gives you enough information to correct this issue and provide better user feedback.

If you need anymore information, just let me know.

Cheers,

ast

Change History (5)

comment:1 Changed 13 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to boeyms@…

Please remember to cc the maintainer.

comment:2 Changed 13 years ago by ast@…

Well, it's different than it was, but it isn't fixed:

--->  Attempting to fetch nginx-1.0.0.tar.gz from http://lil.fr.distfiles.macports.org/nginx
--->  Verifying checksum(s) for nginx
--->  Extracting nginx
--->  Applying patches to nginx
--->  Configuring nginx
--->  Building nginx
--->  Staging nginx into destroot
Error: Target org.macports.destroot returned: error copying "/opt/local/etc/nginx/nginx.conf" to "/opt/local/etc/nginx/nginx.conf.altered": file already exists
Log for nginx is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_nginx/main.log
Error: Unable to upgrade port: 1
To report a bug, see <http://guide.macports.org/#project.tickets>

What the hell is it still doing trying to mess around with my existing nginx.conf file? If the file exists, it should just leave it alone!

Very, very annoying that something like this breaks several hours of 'upgrade outdated'

What's the rationale of the current behavior?

ast

comment:3 Changed 13 years ago by ast@…

Cc: ast@… added

Cc Me!

comment:4 Changed 13 years ago by ast@…

Sorry for being a little too quick with the update to the issue. After I removed the file, I got this message:

sudo port upgrade outdated
--->  Computing dependencies for nginx
--->  Staging nginx into destroot

###############################################################
# It appears that you have altered /opt/local/etc/nginx/nginx.conf,
# and that upgrading or uninstalling your previous installation
# of nginx will clobber your copy.  It has been copied to
# /opt/local/etc/nginx/nginx.conf.altered for preservation when you upgrade or
# uninstall nginx.  This problem should not occur with future
# upgrades or installations of this port.

###############################################################

--->  Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting nginx with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo port load nginx
###########################################################
Warning: violation by /opt/local/html
Warning: nginx violates the layout of the ports-filesystems!
Warning: Please fix or indicate this misbehavior (if it is intended), it will be an error in future releases!
--->  Computing dependencies for nginx
--->  Installing nginx @1.0.0_0
--->  Deactivating nginx @0.8.54_0
--->  Cleaning nginx
--->  Activating nginx @1.0.0_0
--->  Cleaning nginx

I'm not quite sure how to interpret 'This problem should not occur with future upgrades or installations of this port.'

comment:5 Changed 13 years ago by jmroot (Joshua Root)

Cc: ast@… removed
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.