IO.FileNotFound_FileName exception when selecting a file in Silverlight

I don’t know how much this will help people – there’s only 7 results on Google for “IO.FileNotFound_FileName” at the time of writing so it’s clearly not a common problem – but one of our Mac users just reported an issue with selecting a file via a custom Silverlight control. They do this process day in, day out, but suddenly started getting the following error message:

Silverlight IO.FileNotFound_FileName exception

Silverlight IO.FileNotFound_FileName exception

I couldn’t find any evidence of people getting this problem before, the MS page it pointed me to was typically useless. The only suggestion I came across was that it might relate to diskspace having run out, but neither the Mac nor the external fileserver this file was being loaded from were low on space so that ruled that one out.

From a process of trial and error I managed to track the problem down to the folder these files were stored in which, whilst it appeared perfectly normal when viewed on a Mac, when accessed via Windows showed up as gobbledygook. Creating a new folder and copying all the contents over did the trick – the file could be selected and uploaded as before.

Clearly something went very screwy deep down in the OSX filesystem with that folder, though I have absolutely no idea what it might have been. Maybe I missed something really obvious (I have no experience with Macs to call on), but hopefully by bumping the number of Google results up to 8 I might one day save somebody a bit of time 🙂

Posted in Fixes | Tagged , | 4 Responses

Installing RVM on Ubuntu 11.04

I’ve been trying to install RVM on Ubuntu 11.04 and what, according to the installation instructions, should have been a fairly straightforward process turned out to be pretty frustrating. I’m no Linux expert, I’m still picking a lot up, but I couldn’t see any reason why, after each install attempt, I got the following error when attempting to run ‘rvm’:

No command 'rvm' found

I’d installed RVM as a single user using the following command:

bash < <( curl https://rvm.beginrescueend.com/releases/rvm-install-head )

The next step involves adding a line to your .bash_profile file (which in the case of Ubuntu is .profile, although the actual change needs to be made in .bashrc):

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

One thing I was warned about during installation was the presence of a return statement in the above file, which I was instructed to refactor into an if statement (I’m assuming this is standard on Ubuntu as my installation is fairly clean):

WARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc.
This means that if you see '[ -z "$PS1" ] && return' then you must change this line to:
if [[ -n "$PS1" ]] ; then
... original content that was below the && return line ...
fi # <= be sure to close the if.
#EOF .bashrc
Even if you use zsh you should still adjust the .bashrc as above.

I duly made this additional change but eventually discovered I’d made a key mistake; the closing ‘fi’ statement needs to come before the new RVM line, not after it. Maybe this is a no-brainer to most people, and I know it does refer to the original content in the above instructions, but as somebody without a great deal of Linux experience, it wasn’t particularly clear to me which way round these lines should be, and the matter was further compounded by guidance I found on blog posts and forums that had the RVM line inside the if statement.

So if you’re having issues getting RVM to run, double check .bashrc and see if you’ve made the same mistake I did. Don’t forget to reload your profile after making any changes:

source .profile
Posted in Fixes | Tagged , , | 4 Responses

Git “broken pipe” error when pushing to a repository

This is one that’s caught me out on more than one occasion now, hopefully by blogging it I won’t forget about it again quite so soon…

When attempting to push to a git repository over HTTP, you may experience a “broken pipe” error along the lines of the following:

Counting objects: 14466, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3746/3746), done.
error: RPC failed; result=22, HTTP code = 400
fatal: The remote end hung up unexpectedly
Writing objects: 100% (14466/14466), 104.13 MiB | 31.34 MiB/s, done.
Total 14466 (delta 10927), reused 13812 (delta 10474)
fatal: The remote end hung up unexpectedly
fatal: expected ok/error, helper said '2004�Ȍ/↓/Ɠyb��Nj}↑z��"#7‼.m���+x9`>��☼�uhh_������м5���§��z���W?�^&��͙mQM��a`Q�C���Z'

fatal: write error: Broken pipe

This error occurs when the amount of data you’re trying to push in one go exceeds git’s http post buffer which is defined in the docs as:

Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.

Whilst most day to day pushes are likely to be under 1MB, if you’re pushing a large repository over HTTP for the first time, there’s a good chance you’ll exceed this limit, resulting in the above error.

Increasing the buffer is a simple config change to set the new size in bytes (a value which will obviously need to exceed the size of the push that’s erroring):

git config http.postBuffer 209715200

One more thing – even after increasing git’s buffer I was still getting fatal errors. If you also host the destination repository, you need to make sure the server it’s running on doesn’t have a limit to the size of POST requests it will accept – a configuration change may be required to that as well. After I bumped up my max request length, everything worked as expected.

Posted in Fixes | Tagged | 37 Responses

“Access denied” error when installing Orchard modules

I’ve recently started properly battling playing with Orchard and came across a gotcha which may simply have been down to a misunderstanding on my part, but I didn’t find much info when searching for it so figured I’d blog about it myself.

Having set up an initial instance, I switched on the multi-tenancy module so as to install a second instance alongside the first one rather than deploying another copy of Orchard in its entirety. When attempting to install some additional modules within the second instance, I ran into trouble – every time I clicked the “Install” link for a module in the gallery, or the “Install a module from your computer” link within the “Installed” tab of the Modules section, I got an “Access denied” error.

I started checking permissions in various places – my Orchard user account, filesystem ACEs, IIS configuration etc. In the end I had to dive into the code to see what conditions were in use.

Turns out that the problem lay with the fact I was using multi-tenancy – module installation (and possibly themes too though I haven’t checked) is only possible from the default instance, not the other tenants. I’m assuming this is because all tenants share the same modules and themes, and only the default instance is allowed to control them to prevent anarchy breaking out amongst the different tenants. My solution was simple – install the module via the default instance and then go back to the second one where it immediately showed up for me to enable.

Whilst I can see some logic to the business rule here, and maybe it’s spelled out clearly somewhere I missed, I think it could be handled better – there either ought to be a delegation feature within the multi-tenancy module that grants tenants the right to install modules, or a clearer error message when access is denied that makes it immediately obvious what the problem is. At the very least the UI for installing a module ought to be hidden when logged in as a tenant to avoid confusion.

Note the above all applies to Orchard 1.2 – if you’re reading this blog post some time down the line, be aware that it may not apply any more.

Posted in Fixes | Tagged , | 47 Responses

.app pre-registration now open!

I previously blogged about the .app project. As of today they are now open for pre-registration of .app domains, with the caveat that as the rights to the gTLD haven’t actually been secured yet, there is no guarantee the registrations will ever actually go through.

However, rather than simply getting you to pre-register and then sit tight and wait with crossed fingers, they’ve taken quite an innovative approach. Having registered the .app.cc domain, any domain that’s pre-registered automatically comes with a YOURNAME.app.cc subdomain redirect to the URL of your choice. This will continue to work even if the ICANN bid fails.

Multiple people can pre-register the same domain name but only the first person will get the redirect for that name.

Head over to the pre-registration page now and stake a claim to your app name!

Posted in Community | Tagged , , | 5 Responses