Search This Blog

27 August 2009

Private Repositories with Nexus

So one of the projects I am working on is not open source (I know, I know)... that led me to realize I needed to provide both private AND anonymous access to my repositories -- depending on which repo.

A bit of googling and I came across this page.  I mostly followed his instructions -- but here are a few sidenotes in case you go to try it.

In step #2, be careful about long names.  When I got to step 3, I couldn't tell "Anonymous Public Snapshot Repository (read)" apart from "Anonymous Public Snapshot Repository (delete)" since they both looked like "Anonymous Public Snapshot Repositor".

I didn't do the last half of step #5 or step 6. Instead, I went into the user dialog and removed the permissions that the "anonymous" user originally had and added in mine instead.

Here's some screenshots...

This is the roles assigned to the "Public Role"



This is the "Private Role"
This is the "anonymous" user
And my personal user

You can test it by logging out then trying to look at the repositories. You click on the private ones and it says access denied. Public ones are still accessible.

22 August 2009

Subversion working in Unix but not on Windows

So as I was checking out my ambrosia project on Windows today and got this error:

A    ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\phiTest.java
A    ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\PhiTest.java
A    ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\tanTest.java
A    ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\A052119Test.java
A    ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\A073333Test.java
A    ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\eTest.java
A    ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\A113011Test.java
A    ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\piTest.java
svn: In directory 'ambrosia\thoth\src\test\java\org\eoti\math\cf\constants'
svn: Can't open file 'ambrosia\thoth\src\test\java\org\eoti\math\cf\constants\.svn\tmp\text-base\PhiTest.java.svn-base': The system cannot find the file spe
cified.

Now, it may not be obvious looking at the error message, but here's the note as to the reason:

"Failed to add file '(name here)': object of the same name already exists.
or
"Can't open file 'folder\.svn\tmp\text-base\file.svn-base': The system cannot find the file specified."
Both mean that two files in the same folder have the same name except for capitalization; for example "Readme.txt" and "README.TXT". Unix and Subversion are case-sensitive, so the files are considered to be completely unrelated. But in Windows is not case-sensitive, so when it tries to update README.TXT on top of Readme.txt (say), it breaks.
The surest way to fix the problem is to log in to a Unix system (such as io.uwplatt.edu) and use the unix notes to check out the repository there. You can then use the svn mv command to rename one of the files. If you are in the middle of trying to add a file to your repository, you might try using TortoiseSVN->Rename... to rename the existing file to something entirely different and then updating. Note that you need to use the TortoiseSVN rename commands; merely renaming the file in Windows Explorer won't fix your problems. 

Do you see it? We have phi and Phi; phiTest and PhiTest... why you ask? Because phi and Phi are not the same number.  I am not quite sure how I am going to resolve it (well, will have to change the names - but to what?) but have created an issue for it.

18 August 2009

Framework error: code: 28 reason: Operation timed out after 30000 milliseconds

When trying to install a package (in my case openjdk7-dev) you might run into this [on command line OR in the pkg ui]:

Error:
Please check the network connection.
Is the repository accessible?

1: Framework error: code: 28 reason: Operation timed out after 30000 milliseconds with 18904080 out of 20853709 bytes received
URL: 'http://pkg.opensolaris.org/dev'.
2: Framework error: code: 28 reason: Operation timed out after 30000 milliseconds with 18999276 out of 20853709 bytes received
URL: 'http://pkg.opensolaris.org/dev'.
3: Framework error: code: 28 reason: Operation timed out after 30000 milliseconds with 19187200 out of 20853709 bytes received
URL: 'http://pkg.opensolaris.org/dev'.
4: Framework error: code: 28 reason: Operation timed out after 30000 milliseconds with 18991256 out of 20853709 bytes received
URL: 'http://pkg.opensolaris.org/dev'.

The solution to fix this was to simply set an environment variable:
export PKG_CLIENT_TIMEOUT=300

11 August 2009

FTPConnectionClosedException: Connection closed without indication

After installing the ftp server yesterday, I was trying to connect to it with the commons-net library.  Unfortunately it kept failing:

org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed without indication.
    at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:297)
    at org.apache.commons.net.ftp.FTP.getReply(FTP.java:619)
    at org.apache.commons.net.ftp.FTPClient.completePendingCommand(FTPClient.java:1244)
    at org.apache.commons.net.ftp.FTPClient.retrieveFile(FTPClient.java:1301)

As download worked from the browser, I thought this kinda odd.  Looking a little closer, I decided to manually try the steps from the command line and see if I could figure out what was going on.

I ftp'd in and did the same commands I was doing from Java (passive, binary, etc).

When I tried to 'get ' I saw:


150 Opening BINARY mode data connection for aopalliance-1.0.jar (6371 bytes).
421 Service not available, remote server has closed connection
ftp> 

Since I had found through my debugging that after the exception, the 150 FILE_STATUS_OK was the last reply I got; I looked up 421.  It appears that there is a current bug on OpenSolaris that causes this behavior.

So here's the workaround (for the setup I did yesterday):

cp /lib/libsendfile.so.1 /home/ftp/lib
chown root:bin /home/ftp/lib/libsendfile.so.1
svcadm restart ftp

Everything works beautifully now :)

Installing ftpd into a zone

from zone:
  • pkg install SUNWftp
  • svcadm enable ftp
  • ftpconfig /home/ftp ((it will fail at the end))
from global:
  • ftpconfig -d ((zonepath))/root/home/ftp

should work now