EmberJS – Failed to execute ‘setAttribute’ on ‘Element’: ‘=’ is not a valid attribute name.


Just wanted to do a quick post about this error I got when developing an EmberJS Application and trying to test a component (via an Integration test). The following error occurred while running the test:

Error: Failed to execute 'setAttribute' on 'Element': '=' is not a valid attribute name.
    at Error (native)
    at DOMHelper.prototype.setAttribute (http://localhost:4200/assets/vendor.js:12027:13)
    at Object.buildFragment (http://localhost:4200/assets/weldnote.js:24465:13)
    at getCachedFragment (http://localhost:4200/assets/vendor.js:55321:29)
    at Function.RenderResult.build (http://localhost:4200/assets/vendor.js:55044:20)
    at render (http://localhost:4200/assets/vendor.js:55008:37)
    at http://localhost:4200/assets/vendor.js:55799:11
    at renderAndCleanup (http://localhost:4200/assets/vendor.js:55836:18)
    at Object.block [as default] (http://localhost:4200/assets/vendor.js:55797:9)
    at keywords.yield (http://localhost:4200/assets/vendor.js:54620:25)

I was trying to create an integration test for a component like the following (the default generated test, where I removed the block form assertion):

import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('/w-powerselect', 'Integration | Component | w powerselect', {
  integration: true

test('it renders', function(assert) {

  // Set any properties with this.set('myProperty', 'value');
  // Handle any actions with this.on('myAction', function(val) { ... });


  assert.equal(this.$().text().trim(), '');

It was an error message I never seen before, but sure enough it was a simple problem. I had this in my component handlebars template:

<label data-test='label'=>{{label}}</label> 
{{#if canEdit}} 
  <div class="w-powerselect-addon"> 
  <div class='w-powerselect-field' data-test='select-container'>
Can you spot the error? Look closely at the ‘data-test=’label’=>‘. Somehow I left that second ‘=‘ (equal) sign there and it doesn’t make HTMLBars fail the compilation but at runtime it blows up with this weird error.
Happy coding!

JPA Generate Schema – Scripting was requested, but no target was specified

Hi all,

I’ve been making some experiments with the Play Framework (version 2.4.2) and JPA integration (with Hibernate – version 4.3.10). I was trying to make Hibernate generate the SQL Schema based on the JPA annotations I had in my entity classes and stumbled upon the error you see on the title, with the following stack trace:

[ProvisionException: Unable to provision, see the following errors: 1) Error injecting constructor, javax.persistence.PersistenceException: Scripting was requested, but no target was specified at play.db.jpa.DefaultJPAApi$JPAApiProvider.<init>(DefaultJPAApi.java:35) at play.db.jpa.DefaultJPAApi$JPAApiProvider.class(DefaultJPAApi.java:30) while locating play.db.jpa.DefaultJPAApi$JPAApiProvider while locating play.db.jpa.JPAApi

I found that there are some JPA properties to make the provider (in my case, Hibernate) generate the scripts for you (standard properties, no need to use hibernate.hbm2ddl.auto in the persistence.xml file). I’ve found that link through this great answer on stackoverflow.

One of the properties is this:

<property name=“javax.persistence.schema-generation.scripts.action” value=“none / drop / drop-and-create / create “/>

Which when I added to my persistence.xml with any of the values – drop/drop-and-create/create  gave me the said error because I didn’t specify where to create the scripts. That’s what the following properties are for:

  • javax.persistence.schema-generation.scripts.create-target
  • javax.persistence.schema-generation.scripts.drop-target

You have to tell the JPA provider where to create the scripts, hence the error “scripting requested, but no target specified“.

The solution

Add the following properties:

  • <property name=“javax.persistence.schema-generation.scripts.action” value=“drop-and-create”/>
  • <property name=“javax.persistence.schema-generation.scripts.drop-target” value=“conf/db/drop-schema.sql”/>
  • <property name=“javax.persistence.schema-generation.scripts.create-target” value=“conf/db/create-schema.sql”/>

You then get the scripts generated to conf/db/. Hope that helps someone :)

Happy coding!

MySQL very high CPU usage (and other processes)

Hi everyone

TL;DR (or Summary) – Leap second added on 30 June 2015 caused MySQL (and other processes to have very high CPU usage)

This is just a quick post on an issue that I faced today (01/07/2015). I arrived at work and found a warning from our monitoring tool that we had high cpu usage beginning at 01.00 AM. On top we saw several processes using a very high amount of CPU, namely:

  • mysql
  • jenkins
  • tomcat
  • ruby (god)
  • ksoftirqd (several of these)

On Tomcat we can have legitimate high cpu usage, but jenkins was not building anything and mysql (version 5.5.31) was not used in anything important. We ran through the logs and analytics to check if we were having an abnormally high visitor access and found nothing, nada, zero. We logged into mysql and issued the SHOW PROCESSLIST command and nothing was happening.

ksoftird was particularly weird, because it is “is a per-cpu kernel thread that runs when the machine is under heavy soft-interrupt load” which didn’t make any sense to us.

What the…. ? (X-Files theme song playing in the background)

After a certain time and more attempts (like trying to use jstack on tomcat to see if it showed anything unusual) we decided to restart mysql, tomcat, jenkins and god, but it all went back again to high cpu usage. We even restarted the server without better luck.

We then read this stack overflow question more carefully and noticed the “leap second issue”, and someone said “hey I remember seeing something about a leap second not to long ago”… I went and check wikipedia, and sure a leap second was added on June 30th 2015.

We tried the following:

$ /etc/init.d/ntpd stop
$ date -s "`date`"
$ /etc/init.d/ntpd start

Some people said that restarting ntp was not required, but… we did it anyway :) And, it worked. Magically everything went back to normal. Apparently we weren’t the only ones affected. I think the next time I see a leap second announcement I’m going to put it on my calendar and warning to a day before :)

Mozilla’s blog also documents the issue.

I know this issue is documented, but I wanted to have one more post contributing to people finding this stuff on the internet, could save someone a couple of hours next time.

Happy coding and stay safe of leap seconds!

P.S – Reddit comments over here, Hacker News comments over here