Oracle APEX: Error: SyntaxError: Unexpected end of JSON input - sql

I'm having an issue where I've got a button that's action is to 'submit page' upon being clicked. The code then executes a PL SQL statement:
IF :REQUEST = 'btn_create_company' THEN
INSERT INTO COMPANIES (company_name) VALUES(:COMPANY_NAME);
However, when the code comes to execute, whilst it is adding the entry to the database, I'm getting this error on the client which is preventing the page from redirecting after processing:
Error: SyntaxError: Unexpected end of JSON input
I don't understand why this is happening as I'm confident there's nothing wrong with the above statement.

Ok, so I get this problem too, It's when I submit the page but instead of reload the whole page, I'm running a process and stay there.
The process itself works well, however I get the error message, just like you.
So I don't get the a solution, but found a workaround by adding this to the end of my process:
apex_json.open_object;
apex_json.write('success', true);
apex_json.close_object;

You are missing the page number on :COMPANY_NAME. It should be something like :P1_COMPANY_NAME

I was encountering a similar error when operating the last page in a chained dialog (aka "wizard") I had created.
The cause of my issue was that I had created a branch on the "After Submit" with the Behaviour/Type attribute set to "PL/SQL Procedure" and then had the code I wanted to be executed within the PL/SQL code attribute. When the "Finish" button was clicked, I was seeing the same error.
My resolution was to delete the branch and instead to use Create Process, with the Identification/Type set to "PL/SQL Code" and then placing the code I wanted to be executed within the "Source/PL/SQL Code" attribute.

Related

Error when trying to create a project under a GitLab group

I just discovered GitLab's groups and decided that it would be ideal for the kind of work I am doing. I created a private group and am getting the following error when I try to create a project under it:
The form contains the following error:
PG::QueryCanceled: ERROR: canceling statement due to statement timeout CONTEXT: while rechecking updated tuple (0,187) in relation "site_statistics" : UPDATE "site_statistics" SET "repositories_count" = "repositories_count"+1
I attempted to do the same in a new subgroup; however, I still get the same error. I must add that I am not using a paid plan of GitLab.
Thank you.
I have the same issue. I think only thing that we can to do is to wait until this error will fix.
Found this issue page: https://gitlab.com/gitlab-org/gitlab-ce/issues/53778

Cache files always created with wrong permissions in Yii 2

I get this error in my log files every time a cache file doesn't exist it seems. On the first page load, I always get this error
[message] => filemtime(): stat failed for [...]/runtime/cache/my/myapp03eab921185f7b68bbca50d8debc0dda.bin
[file] => [...]/vendor/yiisoft/yii2/caching/FileCache.php
[line] => 113
It doesn't happen anymore on next page loads but that one time is really annoying since the slack bot watcher is spamming our channel with this useless warning. Is there a way to avoid that, or is it a permission problem?
The "runtime", "cache" and "my" folders all have 775.
Update
Turns out the issue is that I'm using error_get_last() that is also getting warning-level errors. So it's a different issue entirely, not Yii-related
Make sure that you don't have enabled scream in your php.ini. Warnings from this filemtime() call should be suppressed by # operator, but scream setting can override this operator and generate warning anyway.
if (#filemtime($cacheFile) > time()) {
// ...
}
You must be getting this in PHP 7.1. try to run this with PHP 5.5 and see if you are getting the same error.
To reproduce you need to delete all files from runtime/cache directory
Then start app again(reload page) and look into runtime/cache. It is empty
Yii2 doesn't make cache again
Got same issue in Yii. The error was on the same string (FileCache.php:113)
if (#filemtime($cacheFile) > time()) {...
In my case reason was that my custom php error handler (heir
of the class yii\base\ErrorHandler) didn't check if
error type need to be handled according error_reporting().
Custom handlers allways gets every error, even muted by Error Control operator (#)
https://www.php.net/manual/en/function.set-error-handler.php
error_reporting() settings will have no effect and your error handler will be called regardless

Like Box - Blogger Error

I'm tring to put facebook Like Box to my blog but after I put Javascript SDK (right after opening body it show me error
**
The reference to entity "appId" must end with the ';' delimiter.
**
and I cant fix it ... :(
What I need to do/edit ???
I had the same problem: fbml=1 appId where I just deleted & and put the closing script right after Load the SDK line. I checked it with the debugger and now there are no errors.
I'm not asking for other permissions, just the "like my page."
{edit. had to change to closing script as the brackets and script didn't show.
Yes, Change the &appId to &appId ant it will work.

Loading feeds / entries getting undefined method 'entries' for 0:fixnum error

I trying to load feeds from my blog but this is resulting in the error in the title mentioned.
The error message:
NoMethodError (undefined method `entries' for 0:Fixnum):
app/controllers/pages_controller.rb:6:in `home'
This is how I'm doing:
I created a file in the libfolder called blog_feeds.rb, that contains only the following:
module BlogFeeds
require 'feedzirra'
def load_feeds
feeds = Feedzirra::Feed.fetch_and_parse('http://blog.shigotodoko.com/feed')
end
end
And the line #6 for the error is:
#feeds = load_feeds.entries
Note that this error only occurs sometimes, not always.
So, any idea about what's going wrong here?
Thank you!
When fetching a feed, Feedzirra will return the HTTP status code instead of an object containing the feed entries, if the HTTP fetch results in an error (i.e. not a 200 or 3XX).
In order to handle this condition gracefully, check the type of the object you get back from fetch_and_parse by wrapping it in something like:
unless feeds.is_a?(Fixnum)
# work with the feeds object
else
# handle the error condition, retry, etc.
end
You should also be able to see these failures by fetching the feed in a browser repeatedly, if it's frequent enough.
Well, seems that was something wrong with my code before.
I was trying to randomize some posts and using something like this on the view:
#feeds.shuffle!.first(5)
In order to get the first 5 random posts.
And to fix it, I just replaced the shuffle! method for the shufflemethod.
Now, everything is working fine!

PHP error_log errors to MySQL

In a previous ticket i asked about logging PHP errors in MySQL which gives me:
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
// mysql connect etc here...
$sql = "INSERT INTO `error_log` SET
`number` = ".mysql_real_escape_string($errno).",
`string` = ".mysql_real_escape_string($errstr).",
`file` = ".mysql_real_escape_string($errfile).",
`line` = ".mysql_real_escape_string($errline);
mysql_query($sql);
// Don't execute PHP internal error handler
return true;
}
// set to the user defined error handler
$new_error_handler = set_error_handler("myErrorHandler");
I can make this work but only if it is triggerred like this:
trigger_error("message here");
However, I also want the error handler to be called for all errors such as syntax errors like:
echo "foo;
But these errors are just outputted to the screen, what am i doing wrong?
You can only handle runtime errors with a custom error handler. The echo "foo error in your example happens when parsing (i.e. reading in) the source. Since PHP can not fully parse the code, it can also not run your error handler on this error.
If You're forced to test if syntax is correct, You can use php_check_syntax function, with filename parameter PHP Manual php_check_syntax
php_check_syntax also provides second parameter, witch when used will be populated by the error string, as far as i remember
That's indeed terrible way of error logging
You don't need not a single advantage of a database. Would you make a database lookup for the certain line number? Or order your results by file name?
database is a subject of many errors itself.
You've been told already that it's impossible to catch a parse error at the program logic level, because a syntactically wrong program will never run.
Let's take your code as an example. It will raise a MySQL error (because of poorly formed query) which you will never see. As well as any other errors occurred. That's what I am talking about.