Ingest-attachment sometimes recognizes files as empty

Hello, I am using elasticsearch:7.9.0 with the ingest-attachment plugin for indexing docx files, created in an external editor.
However, sometimes files are indexed as 'empty',
for example next file:

  _index: 'local.files.en',
  _type: '_doc',
  _id: '1ce6a9a9-f0bf-492e-a9ba-f82839620009',
  _version: 1,
  _seq_no: 0,
  _primary_term: 1,
  found: true,
  _source: {
    filename: 'documents/7a8a4659-0fc2-46f3-8f7a-ceceb9c8e861.docx',
    attachment: {}

as i'am trying to reindex it, result becames the same.
But another similar files, for example this one

is being parsed just fine, and they are almost same by content.
I reprodused issue both locally and on AWS service.


I can reproduce the problem with the ingest attachment plugin in 7.12.0. It is using Tika 1.24 where the most recent version of Tika is now 1.26.
I tried your file with FSCrawler project (which uses Tika 1.26) and I was able to extract the content.

        "_index" : "demo-few-docs",
        "_type" : "_doc",
        "_id" : "ed8cff952cdd81e74891b76ff6c4b6",
        "_score" : 1.0,
        "_source" : {
          "content" : """The Millennium Biltmore Hotel, originally the Los Angeles Biltmore of the Bowman-Biltmore Hotels group, is a luxury hotel located opposite Pershing Square in Downtown Los Angeles, California. Upon its grand opening in 1923, the Los Angeles Biltmore was the largest hotel west of Chicago in the United States.[1] In 1969 the Biltmore Hotel was designated a Los Angeles Historic-Cultural Monument by the City of Los Angeles. In 1951, the Los Angeles Biltmore Hotel Company sold to Corrigan Properties for more than $12 million.[2] Regal Hotels purchased the Biltmore in 1996, and then sold it in 1999 to Millennium & Copthorne Hotels.[3] As of 2009, the Los Angeles Biltmore is operated as part of the Millennium & Copthorne Hotels chain as the Millennium Biltmore Hotel. The hotel has 70,000 square feet (6,500 m2) of meeting and banquet space. From its original 1500 guestrooms it now has 683, due to room reorganization.[4]
· 1Architecture
· 2Restaurants
· 3Events
· 4Films and TV shows
· 4.1Movies
· 4.2Television
· 4.3Music videos
· 5References
· 6External links

Millennium Biltmore Hotel Lobby
The architectural firm Schultze & Weaver designed the Biltmore's exterior in a synthesis of the Spanish-Italian Renaissance Revival, Mediterranean Revival, and Beaux Arts styles, meant as an homage to the Castilian heritage of Los Angeles. The "Biltmore Angel" is heavily incorporated into the design—as a symbol of the city as well as the Biltmore itself. With a thick steel and concrete frame, the structure takes up half a city block and rises over 11 stories.
The interiors of the Biltmore Hotel are decorated with: frescos and murals; carved marblefountains and columns; massive wood-beamed ceilings; travertine and oak paneled walls; lead crystalchandeliers; cast bronze stairwells and doorways; fine artisanmarquetry and mill work; and heavily embroidered imported tapestries and draperies. Most notable are the frescoed mural ceilings in the main Galleria and the Crystal Ballroom, which were hand painted in 1922 by Italian artist John B. Smeraldi, known for his work in the Vatican and the White House. Smeraldi and his team famously painted the ballroom's colorful, seamless fresco over a period of seven months, decorating it with figures of Greek and Roman gods, angels, cupids and other mythological creatures. It was meticulously restored in the 1980s by Smeraldi's apprentice, Anthony Heinsbergen. The imported Austrian crystal chandeliers that adorn it are 12 feet (3.7 m) in diameter.
The Rendezvous Court, once the hotel's lobby but now used primarily for afternoon tea, is decorated with a Moorish Revival styled plaster ceiling painted with 24 Carat Gold accents, two original imported Italian chandeliers from 1923, and a grand Spanish Baroque Revival bronze doorway, whose astrological clock still keeps time today. Two figures appear on the stairwell front—on the left is the Roman goddess of agriculture Ceres, while on the right is the Spanish explorer Vasco Núñez de Balboa. The current lobby at the hotel's Grand Avenue entrance still has its original travertine walls and oak paneling as well as the large artificial skylighted ceiling, reflected in the custom carpet below.

Millennium Biltmore Hotel Galleria
Each ballroom on the Galleria level is themed either after the room's original function or the hotel's overall California-heritage premise. The Emerald Room was once the hotel's main guest dining room; its decor features images of hunt and harvest, with hand-painted animals and fish on the cast-plaster ceiling beams. The Tiffany Room was formerly an open corridor used as a drop-off point for Crystal Ballroom functions. Now enclosed, the elegant space centers around exploration, with relief sculptures and panels depicting Queen Isabella I of Castile, and Christopher Columbus and other Spanish New World explorers. The split-level Gold Room, once a dining room for elite guests, features Prohibition-era hidden liquor compartments and panels along the ceiling for press photographers to take pictures of the event below. It is decorated with a gold cast-plaster ceiling, hand-oiled wood paneling, and nine mirrored windows along three sides.
The South Galleria is painted with floral friezes inspired by the decor of ancient RomanPompeii, and features a vaulted ceiling, marble balustrades and heavy Roman piers. Gold-painted wrought iron gates open to a staircase leading down to the Biltmore Bowl.
Also of interest is the hotel's health club and indoor pool, which was modeled after the decks of 1920s luxury ocean liners. Solid brass trim on windows, doors and railings, teakwood deck chairs and hand-laid Italian mosaic tile on the walls and in the pool are original.
Since 2015, four restaurants and bars serve the hotel, including Smeraldi's Restaurant (American continental cuisine), newly relaunched Bugis Street Brasserie, the Rendezvous Court, and the Gallery Bar.
	This section needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (October 2014) (Learn how and when to remove this template message)

The Los Angeles Biltmore is known for being an early home to the Academy Awards ceremony—the Oscars.[5] The Academy of Motion Picture Arts and Sciences was founded at a luncheon banquet in the Crystal Ballroom in May 1927, when guests such as Louis B. Mayer met to discuss plans for the new organization and presenting achievement awards to colleagues in their industry. Legend has it that MGM art director Cedric Gibbons, who was in attendance, immediately grabbed a linen Biltmore napkin and sketched the design for the Oscar statue on it. Eight Oscar ceremonies were held in the Biltmore Bowl during the Academy's early years of 1931, 1935–39, and 1941–42. In 1977, Bob Hope hosted the Academy's 50th Anniversary banquet in the same room.
The Biltmore Theater was situated at the corner of 5th and Grand, now the Biltmore Court & Tower location. Will Rogers emceed the opening of the theater in 1924, which then hosted plays starring Helen Hayes, Katharine Hepburn, Alfred Lunt, Lynn Fontanne, Bela Lugosi and Mae West until it closed in 1967. It also occasionally booked high-profile films such as the 1925 silent epic Ben Hur: A Tale of the Christ which ran for 14 weeks in 1926 and silent Academy Award winnerWings, which stayed over 20 weeks in 1928.[6]
In 1929, Germany's Graf Zeppelin airship soared over the hotel on its round-the-world voyage, sponsored by newspaper magnate William Randolph Hearst. Crew and passengers were fed by Biltmore culinary staff, who also replenished their on-board supplies.
During World War II, the Biltmore served as a military rest and recreation facility, with the entire second floor equipped with cots for military personnel on leave.
On March 7, 1952, the well-known yogi and author Paramahansa Yogananda, collapsed and died of a heart attack after finishing a speech in honor of the Indian ambassador Binay Ranjan Sen.[7][8] This site within the hotel is now revered by many as the place of the yogi's mahasamadhi, or conscious leave of the body.
The 1960 Democratic National Convention in Los Angeles chose John F. Kennedy as the party's presidential nominee. He set up his campaign headquarters in the Music Room (now the Lobby), with running mate Lyndon B. Johnson across the hall in the Emerald Room. Their press conferences in the Crystal Ballroom were heavily photographed and documented.
The Beatles paid a visit to the Presidential Suite in August 1964 during their first U.S. tour. Due to the overwhelming number of fans crowding the sidewalks in front of the hotel, the "Fab Four" were forced to access their room by landing atop the hotel in a helicopter.[citation needed]
The Los Angeles Biltmore Hotel served the International Olympic Committee as their headquarters during the 1984 Summer Olympics. In 1988, the Duke & Duchess of York were hosted by Armand Hammer at a Biltmore gala. Recently the Biltmore has hosted the semi-finals for American Idol, the yearly awards for the Cinemal Audio Society, visiting teams for the World Baseball Classic, and multiple Grammy Awards after-parties.
Films and TV shows[edit]
· Scenes from many movies and television shows have been filmed at the hotel, including:
10 Things I Hate About You, ‘’Alien Nation, Bachelor Party (1984), Beverly Hills Cop, Blow, Blue Streak, Bugsy, Chinatown (1974), Daredevil, Dave, The Fabulous Baker Boys, The Game (1997), Ghostbusters (1984), Heartbreakers (2001), In the Line of Fire, Independence Day (1996), The Italian Job (2003), National Treasure, The Nutty Professor (1996), Ocean's 11, Pretty in Pink, Prom Night (2008), Something New, Spider-Man (2002), Splash, A Star Is Born (1937), True Lies, Wedding Crashers, The Wedding Ringer.
The hotel's exterior can also be seen in Cruel Intentions, Fight Club and Heat.
24, Ally McBeal, Beverly Hills, 90210, Black Monday, Bosch, Charlie's Angels, Columbo, CSI: NY, Drop Dead Diva, Entourage, ER, Glee, The Good Place, Heroes, House, Leverage, Mad Men, Mob City, Nip/Tuck, NYPD Blue, The Real Housewives of Beverly Hills, Scandal, That '70s Show, War and Remembrance, The West Wing.[citation needed]
The hotel also has been featured in a commercial for Stanton Optical, a company based in Palm Springs, Florida.

Signature Page for Pollens - Weeds_Alive back figure_CMN_EUPI_Internally-Approved_12-Feb-2021_en_0.0-0.11
	Test User <changed>
12-02-2021 14:30:51 GMT+0000

Signature Page for Pollens - Weeds_Alive back figure_CMN_EUPI_Internally-Approved_12-Feb-2021_en_0.0-0.11


          "meta" : {
            "date" : "2021-02-12T12:21:30.000+00:00",
            "language" : "en",
            "modifier" : "Corazon Landolt"
          "file" : {
            "extension" : "docx",
            "content_type" : "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
            "created" : "2021-04-02T08:23:43.000+00:00",
            "last_modified" : "2021-04-02T08:23:43.611+00:00",
            "last_accessed" : "2021-04-02T08:23:55.965+00:00",
            "indexing_date" : "2021-04-02T08:25:16.142+00:00",
            "filesize" : 581397,
            "filename" : "not_indexed.docx",
            "url" : "file:///Users/dpilato/Documents/Elasticsearch/Talks/workplace-search-fscrawler/docs/test/not_indexed.docx"
          "path" : {
            "root" : "dd7442137acf12cc6937df7afd8478",
            "virtual" : "/not_indexed.docx",
            "real" : "/Users/dpilato/Documents/Elasticsearch/Talks/workplace-search-fscrawler/docs/test/not_indexed.docx"

So I'd recommend opening an issue in Issues · elastic/elasticsearch · GitHub as you did here.
It might be fixed by "just" upgrading Tika in the ingest attachment plugin.

BTW did you look at Cloud by Elastic, also available if needed from AWS Marketplace?

Cloud by elastic is one way to have access to all features, all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named Observability, Security, Enterprise Search and what is coming next :slight_smile: ...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.