Flume hdfs sink keep making .tmp files - flume

Some of the HDFS sink files are not closed
Some say that if the sink process fails with problems such as Timeout condition, it doesn't try to close the file again.
I have been look into my flume log file, but there are no error.
However, the log file shows that every cycle, flume makes two tmp files and close only one tmp file...
Any suggestion for the config would be appreciated!
Thanks!
#Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
#Configure the Kafka Source
a1.sources.r1.type = org.apache.flume.source.kafka.KafkaSource
a1.sources.r1.batchSize = 1000
#a1.sources.r1.batchDurationMillis = 2000
a1.sources.r1.kafka.bootstrap.servers = 150.2.237.16:6667,150.2.237.17:6667
a1.sources.r1.kafka.topics = 1-sysmaster1-thread
a1.sources.r1.kafka.consumer.group.id = flume_hdfs_consumer
#Describe the sink
a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path = /user/flume/kafka-data/1-sysmaster1-thread/%y%m%d
a1.sinks.k1.hdfs.filePrefix = 1-sysmaster1-thread-%H%M
#Describing sink with the problem of Encoding
a1.sinks.k1.hdfs.fileType = DataStream
a1.sinks.k1.hdfs.writeFormat = Text
#Describing sink with the problem of many hdfs files
### Roll a file after certain amount of events occurs ###
a1.sinks.k1.hdfs.rollInterval = 0
a1.sinks.k1.hdfs.rollSize = 0
a1.sinks.k1.hdfs.rollCount = 10000
a1.sinks.k1.hdfs.batchSize = 1000
#Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 10000
a1.channels.c1.transactionCapacity = 1000
#Use File channel
#a1.channels.c1.type = file
#a1.channels.cl.checkpointDir = /home/bigdata/flume/checkpoint
#a1.channels.c1.dataDirs = /home/bigdata/flume/data
#Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
23 4월 2019 11:47:04,105 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.open:246) - Creating /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1147.1555987622865.tmp
23 4월 2019 11:48:03,382 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.HDFSDataStream.configure:57) - Serializer = TEXT, UseRawLocalFileSystem = false
23 4월 2019 11:48:03,457 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.open:246) - Creating /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1148.1555987683383.tmp
23 4월 2019 11:48:08,664 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.doClose:438) - Closing /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1148.1555987683383.tmp
23 4월 2019 11:48:08,689 INFO [hdfs-k1-call-runner-8] (org.apache.flume.sink.hdfs.BucketWriter$7.call:681) - Renaming /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1148.1555987683383.tmp to /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1148.1555987683383
23 4월 2019 11:48:08,712 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.open:246) - Creating /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1148.1555987683384.tmp
23 4월 2019 11:49:03,711 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.HDFSDataStream.configure:57) - Serializer = TEXT, UseRawLocalFileSystem = false
23 4월 2019 11:49:03,806 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.open:246) - Creating /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1149.1555987743712.tmp
23 4월 2019 11:49:05,439 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.doClose:438) - Closing /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1149.1555987743712.tmp
23 4월 2019 11:49:05,460 INFO [hdfs-k1-call-runner-5] (org.apache.flume.sink.hdfs.BucketWriter$7.call:681) - Renaming /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1149.1555987743712.tmp to /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1149.1555987743712
23 4월 2019 11:49:05,480 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.open:246) - Creating /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1149.1555987743713.tmp
23 4월 2019 11:50:02,354 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.HDFSDataStream.configure:57) - Serializer = TEXT, UseRawLocalFileSystem = false
23 4월 2019 11:50:02,387 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.open:246) - Creating /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1150.1555987802355.tmp
23 4월 2019 11:50:03,015 INFO [SinkRunner-PollingRunner-DefaultSinkProcessor] (org.apache.flume.sink.hdfs.BucketWriter.doClose:438) - Closing /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1150.1555987802355.tmp
23 4월 2019 11:50:03,032 INFO [hdfs-k1-call-runner-4] (org.apache.flume.sink.hdfs.BucketWriter$7.call:681) - Renaming /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1150.1555987802355.tmp to /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1150.1555987802355
[root#sd-mds-01 logs]# hdfs dfs -ls /user/flume/kafka-data/1-sysmaster1-thread/190423/
Found 163 items
-rw-r--r-- 3 root hdfs 1781109 2019-04-23 11:20 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1120.1555986001199
-rw-r--r-- 3 root hdfs 212118 2019-04-23 11:20 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1120.1555986001200.tmp
-rw-r--r-- 3 root hdfs 1777270 2019-04-23 11:21 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1121.1555986062575
-rw-r--r-- 3 root hdfs 54451 2019-04-23 11:21 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1121.1555986062576.tmp
-rw-r--r-- 3 root hdfs 1781741 2019-04-23 11:22 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1122.1555986123181
-rw-r--r-- 3 root hdfs 34735 2019-04-23 11:22 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1122.1555986123182.tmp
-rw-r--r-- 3 root hdfs 1782315 2019-04-23 11:23 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1123.1555986183768
-rw-r--r-- 3 root hdfs 28682 2019-04-23 11:23 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1123.1555986183769.tmp
-rw-r--r-- 3 root hdfs 1782437 2019-04-23 11:24 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1124.1555986244304
-rw-r--r-- 3 root hdfs 211547 2019-04-23 11:24 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1124.1555986244305.tmp
-rw-r--r-- 3 root hdfs 1782775 2019-04-23 11:25 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1125.1555986302891
-rw-r--r-- 3 root hdfs 35918 2019-04-23 11:25 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1125.1555986302892.tmp
-rw-r--r-- 3 root hdfs 1781180 2019-04-23 11:26 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1126.1555986362097
-rw-r--r-- 3 root hdfs 30967 2019-04-23 11:26 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1126.1555986362098.tmp
-rw-r--r-- 3 root hdfs 1781682 2019-04-23 11:27 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1127.1555986423432
-rw-r--r-- 3 root hdfs 41381 2019-04-23 11:27 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1127.1555986423433.tmp
-rw-r--r-- 3 root hdfs 1781710 2019-04-23 11:28 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1128.1555986483928
-rw-r--r-- 3 root hdfs 211240 2019-04-23 11:28 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1128.1555986483929.tmp
-rw-r--r-- 3 root hdfs 1785456 2019-04-23 11:29 /user/flume/kafka-data/1-sysmaster1-thread/190423/1-sysmaster1-thread-1129.1555986542442

I found the problem...
I set the config to roll the file with the prefix of time
a1.sinks.k1.hdfs.filePrefix = 1-sysmaster1-thread-%H%M
As you can see the result path, Every file made at the end of minute, it cannot be rolled up properly.
After I removed the line from the config file, It works fine.

Related

Lua can't import a module and says file not found but the file exists

i'm trying to run a lua script from inside haproxy that imports the "pgmoon" library. i can import pgmoon and get as far as opening a socket, but then i run into this:
[ALERT] 082/234313 (8) : Lua function 'queue-request': runtime error: /usr/local/share/lua/5.3/pgmoon/init.lua:269: module 'pgmoon.crypto' not found:
no field package.preload['pgmoon.crypto']
no file '/usr/local/share/lua/5.3/pgmoon/crypto.lua'
no file '/usr/local/share/lua/5.3/pgmoon/crypto/init.lua'
no file '/usr/local/lib/lua/5.3/pgmoon/crypto.lua'
no file '/usr/local/lib/lua/5.3/pgmoon/crypto/init.lua'
no file '/usr/share/lua/5.3/pgmoon/crypto.lua'
no file '/usr/share/lua/5.3/pgmoon/crypto/init.lua'
no file './pgmoon/crypto.lua'
no file './pgmoon/crypto/init.lua'
no file '/usr/local/lib/lua/5.3/pgmoon/crypto.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.3/pgmoon/crypto.so'
no file '/usr/lib/lua/5.3/pgmoon/crypto.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './pgmoon/crypto.so'
no file '/usr/local/lib/lua/5.3/pgmoon.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.3/pgmoon.so'
no file '/usr/lib/lua/5.3/pgmoon.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './pgmoon.so' from [C] global 'require', /usr/local/share/lua/5.3/pgmoon/init.lua:269 C function line 267 ..., /usr/local/share/lua/5.3/pgmoon/init.lua:211 method 'connect', /usr/local/haproxy/queue-request.lua:38 C function line 25.
however, there is a file at /usr/local/share/lua/5.3/pgmoon/crypto.lua, this is what ls shows:
# ls -la /usr/local/share/lua/5.3/pgmoon/
total 60
drwxr-xr-x 1 root root 4096 Mar 24 23:42 .
drwxr-xr-x 1 root root 4096 Mar 24 23:00 ..
-rw-r--r-- 1 root root 2880 Mar 24 23:00 arrays.lua
-rw-r--r-- 1 root root 1130 Mar 24 23:00 bit.lua
-rw-r--r-- 1 root root 1587 Mar 24 23:00 cqueues.lua
-rw-r--r-- 1 root root 654 Mar 24 23:00 crypto.lua
-rw-r--r-- 1 root root 2084 Mar 24 23:00 hstore.lua
-rw-r--r-- 1 root root 20127 Mar 24 23:00 init.lua
-rw-r--r-- 1 root root 665 Mar 24 23:00 json.lua
-rw-r--r-- 1 root root 2728 Mar 24 23:42 socket.lua
-rw-r--r-- 1 root root 457 Mar 24 23:00 util.lua
i could see it being permissions-related, if the haproxy user couldn't access a root owned file, but by the time it gets here it's already executed init.lua which has imported socket.lua and they've all got the same permissions...
Anybody know why lua thinks there is no file at crypto.lua?
I guess that you have haproxy configured with chroot and there actually isn't a file at /usr/local/share/lua/5.3/pgmoon/crypto.lua - in the chroot you haproxy runs in.
The require('pgmoon.crypto') in init.lua is within a function and probably tries to run long after Haproxy and lua initialization - and the root change.
And somewhat (un)relatedly - you can probably expect other problems with the pgmoon not being aware of haproxy, eg. its use of luasocket and not the haproxy-provided replacement: https://www.haproxy.com/blog/5-ways-to-extend-haproxy-with-lua/
The Socket class is a replacement for the standard Lua Socket class and is compatible with HAProxy’s non-blocking nature. When you want to use socket functions in your actions, you must use this class.

Jenkins symlinks/permalinks broken after restart

Jenkins version 2.114 is running builds but they seem to disappear from the Dashboard after a restart. I have Jenkins setup on Linux and all the log is present under
${JENKINS_HOME}/jobs/${ITEM_FULL_NAME}/builds
I have tried Reload Configuration from Disk with following set in /etc/sysconfig/jenkins
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
Below is build and workspace directory settings:
Workspace Root Directory :${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}
Build Record Root Directory: ${ITEM_ROOTDIR}/builds
Below you can see the build number 117 and 118, but still, the lastFailedBuild, lastStableBuild , lastSuccessfulBuild are set to -1, which doesn't exist
drwxr-xr-x 4 jenkins jenkins 4096 Apr 2 20:17 117
drwxr-xr-x 4 jenkins jenkins 4096 Apr 3 20:17 118
lrwxrwxrwx 1 jenkins jenkins 2 Apr 3 11:09 lastFailedBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 2 Apr 4 10:44 lastStableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 2 Apr 4 03:21 lastSuccessfulBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 2 Apr 3 10:58 lastUnstableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 2 Apr 3 10:58 lastUnsuccessfulBuild -> -1
I have also set the
Discard Old Builds Slicer - Days to keep artifacts as 30
Discard Old Builds Slicer - Max # of builds to keep as 40
I ran the jenkins-job-checker[ https://github.com/docwhat/jenkins-job-checker ] on one of the jobs and found the following :
Problem: NOTLINK: The number link builds/1 is not a symlink!
Problem: NOTLINK: The number link builds/2 is not a symlink!
Problem: NOTLINK: The number link builds/3 is not a symlink!
Proposal: Archive non-link builds/1
Proposal: Archive non-link builds/2
Proposal: Archive non-link builds/3
Really appreaciate some help
The links have been replaced with the permalinks file:
rwxr-xr-x 2 jenkins jenkins 4096 Aug 6 2018 98
drwxr-xr-x 2 jenkins jenkins 4096 Aug 7 2018 99
lrwxrwxrwx 1 jenkins jenkins 3 Jan 19 13:47 lastFailedBuild -> 649
lrwxrwxrwx 1 jenkins jenkins 3 Jan 19 13:48 lastSuccessfulBuild -> 622
lrwxrwxrwx 1 jenkins jenkins 2 Jun 14 2018 lastUnstableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 3 Jan 19 13:49 lastUnsuccessfulBuild -> 649
-rw-r--r-- 1 jenkins jenkins 0 Jun 14 2018 legacyIds
-rw-r--r-- 1 jenkins jenkins 134 Jan 19 14:42 permalinks
jenkins#ip-1-9-2-253_jenkins:~/jobs/cron_dockers/jobs/ios/builds$ cat permalinks
lastCompletedBuild 651
lastFailedBuild 650
lastStableBuild 651
lastSuccessfulBuild 651
lastUnstableBuild -1
lastUnsuccessfulBuild 650
Make sure the values in the permalinks file are correct, these are the values that are used to generate the values in the Jenkins GUI.
I installed the plugin operations-center-context and that solved my problem
I found the solution in below link:
https://support.cloudbees.com/hc/en-us/articles/216227047-After-moving-a-job-symlinks-for-folders-became-actual-folders

Xcode Unit Tests returns the NSURL of temp folder without 'private keyword'

I am writing Unit Tests in Objective C.
The following is my code:
NSString *testTempDirectory = [NSString stringWithFormat:#"%#%#", NSTemporaryDirectory(), #"DC_Tests"];
NSURL *parentDirURL = [NSURL fileURLWithPath:testTempDirectory];
NSURL *testFolderURL = [NSURL fileURLWithPath:testFolderPath];
Now the path in testFolderURL is returned as
/var/folders/31/2dpztnmx4fzfxb87qtn5_n0wc49pvz/T/DC_Tests/testFolder/
But the original path is
/private/var/folders/31/2dpztnmx4fzfxb87qtn5_n0wc49pvz/T/DC_Tests/testFolder/
The original path is my expected path and since it is different, my assertion is failing.
Any idea as to how do I get the complete path.
Note: I tried absolute string, doesn't help.
Note that in Mac OS, the var folder is actually a linked folder to /private/var
$ ls -l /
total 45
drwxrwxr-x+ 61 root admin 2074 Jun 11 08:58 Applications
drwxr-xr-x+ 63 root wheel 2142 Jul 6 2016 Library
drwxr-xr-x# 2 root wheel 68 Aug 24 2015 Network
drwxr-xr-x# 4 root wheel 136 Jun 9 18:56 System
drwxr-xr-x 6 root admin 204 Apr 22 2016 Users
drwxrwxrwt# 4 root admin 136 Jun 15 09:53 Volumes
drwxr-xr-x# 39 root wheel 1326 Jun 9 18:56 bin
drwxrwxr-t# 2 root admin 68 Aug 24 2015 cores
dr-xr-xr-x 3 root wheel 4312 Jun 9 18:57 dev
lrwxr-xr-x# 1 root wheel 11 Oct 18 2015 etc -> private/etc
dr-xr-xr-x 2 root wheel 1 Jun 9 18:58 home
-rw-r--r--# 1 root wheel 313 Aug 23 2015 installer.failurerequests
dr-xr-xr-x 2 root wheel 1 Jun 9 18:58 net
drwxr-xr-x# 6 root wheel 204 Oct 18 2015 private
drwxr-xr-x# 59 root wheel 2006 Jun 9 18:56 sbin
lrwxr-xr-x# 1 root wheel 11 Oct 18 2015 tmp -> private/tmp
drwxr-xr-x# 13 root wheel 442 Apr 19 2016 usr
lrwxr-xr-x# 1 root wheel 11 Oct 18 2015 var -> private/var
So the simplest way to fix your test is to ignore the /private part from the path. (We had a similar issue with paths that contain the tmp folder on Mac OS as well)

Rails 4 SQLite3::ReadOnlyException: attempt to write a readonly database

I keep receiving the error SQLite3::ReadOnlyException: attempt to write a readonly database: UPDATE "users" SET "current_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = ? when trying to sign into my Rails 4 app which uses the devise gem.
I figured it has something to do with permissions on the dev db so checked out the permissions of the dir first, it has a + tacked onto the end which after some googling still couldn't figure out what it's doing.
-rw-r--r-- 1 a36971 staff 2.1K 24 Jan 20:16 Gemfile
-rw-r--r-- 1 a36971 staff 5.7K 24 Jan 20:16 Gemfile.lock
-rw-r--r-- 1 a36971 staff 47B 7 Jan 22:31 README.md
-rw-r--r--+ 1 root staff 249B 7 Jan 19:57 Rakefile
drwxr-xr-x+ 8 root staff 272B 7 Jan 19:57 app/
drwxr-xr-x+ 7 root staff 238B 7 Jan 19:57 bin/
drwxr-xr-x+ 13 root staff 442B 22 Jan 20:14 config/
-rw-r--r--+ 1 root staff 153B 7 Jan 19:57 config.ru
drwxr-xr-x+ 8 root staff 272B 26 Jan 10:28 db/
drwxr-xr-x+ 4 root staff 136B 7 Jan 19:57 lib/
drwxr-xr-x+ 5 root staff 170B 8 Jan 15:51 log/
drwxr-xr-x+ 7 root staff 238B 7 Jan 19:57 public/
drwxr-xr-x 7 a36971 staff 238B 17 Jan 22:38 spec/
drwxr-xr-x+ 9 root staff 306B 7 Jan 19:57 test/
drwxr-xr-x+ 6 root staff 204B 7 Jan 20:19 tmp/
drwxr-xr-x+ 3 root staff 102B 7 Jan 19:57 vendor/
After cd ing into the db dir you can see there's nothing wrong with the permissions on the db itself:
-rw-r--r-- 1 a36971 staff 44K 26 Jan 09:30 development.sqlite3
drwxr-xr-x 5 a36971 staff 170B 22 Jan 20:14 migrate/
-rw-r--r-- 1 a36971 staff 2.2K 22 Jan 20:14 schema.rb
-rw-r--r-- 1 a36971 staff 1.2K 25 Jan 23:22 seeds.rb
-rw-r--r-- 1 a36971 staff 44K 26 Jan 09:23 test.sqlite3
So my questions are:
a) why is it unable to write to the db when there doesn't appear to be anything wrong with the permissions themselves
b) what does the + mean on mac os?
a) why is it unable to write to the db when there doesn't appear to be anything wrong with the permissions themselves
My best guess is that the db/ directory is owned by the root user, whereas the db/*.sqlite3 files are owned by user a36971. It may be necessary for the db/ directory to also be owned by user a36971.
Try changing the owner from root to a36971 for the db directory:
sudo chown a36971 db
b) what does the + mean on mac os?
+ sign means there are additional permission details not displayed by the default output from ls -l. Try running ls -le to see the details (source: http://tech.enekochan.com/en/2014/05/29/plus-and-at-symbols-listing-file-permissions-in-mac-os-x/).
Got the same error after running rails db:reset
Restarting the local server fixed my problem

liferay page layout thumbnails not showing up

The issue is that I am not able to see thumbnails of the Page layouts. I am working on Liferay Portal EE 6.1.20.
When I go to Manage -> Page Layout, I cannot see the thumbnails.
Few things
I am not using OOB Liferay, it is a custom solution where Liferay is bundled as a custom portal solution
This thing works fine in Liferay OOB, so there must be some configuration issue
I tried to debug with Firebug and it is able to fetch the image from the URL specified.
The context path is changed from / to /portal
The generated image URL is like this /portal/layouttpl/custom/1_2_columns_ii.png. This is also not accessible from the browser itself.
The other URLS like /portal/html or /portal/wap/ working fine. Only from /portal/layouttpl does not allow to access static resources.
Any Idea?
It might be worth checking the file permissions of the images. In my Liferay development enviroment, I have all of my images set to 777:
user#ubuntu:/usr/liferay/tomcat/webapps/ROOT/layouttpl/custom$ ll *.png
-rwxrwxrwx 1 root root 1801 Apr 2 2012 1_2_1_columns.png*
-rwxrwxrwx 1 root root 1798 Apr 2 2012 1_2_columns_ii.png*
-rwxrwxrwx 1 root root 1793 Apr 2 2012 1_2_columns_i.png*
-rwxrwxrwx 1 root root 1425 Apr 2 2012 1_column.png*
-rwxrwxrwx 1 root root 1923 Apr 2 2012 2_2_columns.png*
-rwxrwxrwx 1 root root 1718 Apr 2 2012 2_columns_iii.png*
-rwxrwxrwx 1 root root 1735 Apr 2 2012 2_columns_ii.png*
-rwxrwxrwx 1 root root 1618 Apr 2 2012 2_columns_i.png*
-rwxrwxrwx 1 root root 1852 Apr 2 2012 3_columns.png*
-rwxrwxrwx 1 root root 1740 Apr 2 2012 freeform.png*

Resources