c.1300, probably from Old Norse skrapa "to scrape, erase," from Proto-Germanic *skrapojan (cf. Old English scrapian "to scrape," Dutch schrapen, German schrappen). To scrape the bottom of the barrel in figurative sense is from 1942.
mid-15c., "a scraping instrument;" late 15c., "act of scraping or scratching," from scrape (v.). Meaning "embarrassing or awkward predicament" is recorded from 1709, as OED suggests, "probably from the notion of being 'scraped' in going through a narrow passage."